Commit 8702cef2 authored by http://jneen.net/'s avatar http://jneen.net/

don't double-cache project_abilites

parent 99ee8620
......@@ -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))
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment