summaryrefslogtreecommitdiff
path: root/app/models/ability.rb
diff options
context:
space:
mode:
authorhttp://jneen.net/ <jneen@jneen.net>2016-08-18 10:39:49 -0700
committerhttp://jneen.net/ <jneen@jneen.net>2016-08-30 11:39:22 -0700
commit06ba2602c59e5f6627d892ed9fdb2dafade5768b (patch)
treee477de81514deeb98913996659859b7860fe3cc9 /app/models/ability.rb
parent5b7edc74b65f6855d3744ba600f3972c8cbb5894 (diff)
downloadgitlab-ce-06ba2602c59e5f6627d892ed9fdb2dafade5768b.tar.gz
take the dive - only use abilities from Policies
Diffstat (limited to 'app/models/ability.rb')
-rw-r--r--app/models/ability.rb9
1 files changed, 1 insertions, 8 deletions
diff --git a/app/models/ability.rb b/app/models/ability.rb
index fe171cd1a8b..b57ada715df 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -61,14 +61,7 @@ class Ability
private
def uncached_allowed(user, subject)
- policy_class = BasePolicy.class_for(subject) rescue nil
- return policy_class.abilities(user, subject) if policy_class
-
- return anonymous_abilities(subject) if user.nil?
- return [] unless user.is_a?(User)
- return [] if user.blocked?
-
- abilities_by_subject_class(user: user, subject: subject)
+ BasePolicy.class_for(subject).abilities(user, subject)
end
def abilities_by_subject_class(user:, subject:)