diff options
author | http://jneen.net/ <jneen@jneen.net> | 2016-08-16 22:05:44 +0300 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2016-08-30 21:39:22 +0300 |
commit | 16fe6dc7b159a0e6b68a586065de1f95d6acecfa (patch) | |
tree | afcf34e0af423e603a915dbda365a4ab5e608d74 /app/policies/base_policy.rb | |
parent | 092861093066f6b474c2dc72de34acf64380a3e6 (diff) |
port CommitStatus/Build
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 fd5d05a1bd1..e1757d97e89 100644 --- a/app/policies/base_policy.rb +++ b/app/policies/base_policy.rb @@ -30,6 +30,10 @@ class BasePolicy @can.merge(BasePolicy.class_for(new_subject).abilities(@user, new_subject)) end + def can?(rule) + @can.include?(rule) && !@cannot.include?(rule) + end + def can!(*rules) @can.merge(rules) end |