diff options
author | http://jneen.net/ <jneen@jneen.net> | 2016-08-17 02:29:19 +0300 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2016-08-30 21:39:22 +0300 |
commit | 9a0ea1350131368b9b723f1a9581bbfffe7c43f8 (patch) | |
tree | eb85189813369c421e992661029c3d4b22685b1a /app/policies/base_policy.rb | |
parent | 2944022835d872b472d8691082ef67aa3057d2b4 (diff) |
factor in global permissions
Diffstat (limited to 'app/policies/base_policy.rb')
-rw-r--r-- | app/policies/base_policy.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/policies/base_policy.rb b/app/policies/base_policy.rb index 12f60d8f76e..5a5b99c81c8 100644 --- a/app/policies/base_policy.rb +++ b/app/policies/base_policy.rb @@ -4,6 +4,8 @@ class BasePolicy end def self.class_for(subject) + return GlobalPolicy if subject.nil? + subject.class.ancestors.each do |klass| next unless klass.name @@ -59,8 +61,6 @@ class BasePolicy private def collect_rules(&b) - return Set.new if @subject.nil? - @can = Set.new @cannot = Set.new yield |