diff options
author | http://jneen.net/ <jneen@jneen.net> | 2016-08-08 14:02:29 -0700 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2016-08-30 11:32:55 -0700 |
commit | 8702cef27146ab62d44065af3f3d388c7effcedb (patch) | |
tree | 3123511aa80a12a2250597b6befed259e61a7935 /app/models/ability.rb | |
parent | 99ee86206e3e19dd93910a4e7a3a5b6e3a7add9a (diff) | |
download | gitlab-ce-8702cef27146ab62d44065af3f3d388c7effcedb.tar.gz |
don't double-cache project_abilites
Diffstat (limited to 'app/models/ability.rb')
-rw-r--r-- | app/models/ability.rb | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/app/models/ability.rb b/app/models/ability.rb index 622f481a4fc..595e6be6642 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -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) |