diff options
author | http://jneen.net/ <jneen@jneen.net> | 2017-04-07 00:06:42 +0300 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2017-06-27 22:44:37 +0300 |
commit | 37c401433b76170f0150d70865f1f4584db01fa8 (patch) | |
tree | 2da7a4c072b863e0cb927993d8d39e7029d720e4 /app/policies/commit_status_policy.rb | |
parent | e5aad75a2673b2e4465d311cbd27970d5c81d5f7 (diff) |
convert all the policies to DeclarativePolicy
Diffstat (limited to 'app/policies/commit_status_policy.rb')
-rw-r--r-- | app/policies/commit_status_policy.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/policies/commit_status_policy.rb b/app/policies/commit_status_policy.rb index 593df738328..24b2a4cc7fd 100644 --- a/app/policies/commit_status_policy.rb +++ b/app/policies/commit_status_policy.rb @@ -1,5 +1,7 @@ class CommitStatusPolicy < BasePolicy - def rules - delegate! @subject.project + delegate { @subject.project } + + %w[read create update admin].each do |action| + rule { ~can?(:"#{action}_commit_status") }.prevent :"#{action}_build" end end |