Skip to content
Snippets Groups Projects
Commit 8702cef2 authored by http://jneen.net/'s avatar http://jneen.net/
Browse files

don't double-cache project_abilites

parent 99ee8620
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -181,17 +181,8 @@ class Ability
end
 
def project_abilities(user, project)
key = "/user/#{user.id}/project/#{project.id}"
if RequestStore.active?
RequestStore.store[key] ||= uncached_project_abilities(user, project)
else
uncached_project_abilities(user, project)
end
end
def uncached_project_abilities(user, project)
rules = []
# Push abilities on the users team role
rules.push(*project_team_rules(project.team, user))
 
Loading
Loading
@@ -218,7 +209,7 @@ class Ability
rules -= project_archived_rules
end
 
(rules - project_disabled_features_rules(project)).uniq
rules - project_disabled_features_rules(project)
end
 
def project_team_rules(team, user)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment