BigW Consortium Gitlab

Commit 06ba2602 by http://jneen.net/

take the dive - only use abilities from Policies

parent 5b7edc74
......@@ -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:)
......
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