diff options
author | Rémy Coutable <remy@rymai.me> | 2017-01-09 23:43:15 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-01-18 18:38:34 +0300 |
commit | fd72c0f4c748658f539d24a286366e9ac7a22b57 (patch) | |
tree | 008efd12ec9d7a4798a338add49b777ffe5f6676 /app/policies/base_policy.rb | |
parent | b4f67cc2294f262d35fe63cc1e60eccebc4667ac (diff) |
Handle presenters in BasePolicy
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/policies/base_policy.rb')
-rw-r--r-- | app/policies/base_policy.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/policies/base_policy.rb b/app/policies/base_policy.rb index 118c100ca11..43b4a15b81a 100644 --- a/app/policies/base_policy.rb +++ b/app/policies/base_policy.rb @@ -53,6 +53,10 @@ class BasePolicy def self.class_for(subject) return GlobalPolicy if subject.nil? + if subject.class.ancestors.include?(Gitlab::View::Presenter::Base) + subject = subject.subject + end + subject.class.ancestors.each do |klass| next unless klass.name |