diff options
author | Kamil TrzciĆski <ayufan@ayufan.eu> | 2017-03-07 13:02:56 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-03-07 13:02:56 +0000 |
commit | 32dee03b2fec293a8581034301bab9d4a3f86d1a (patch) | |
tree | ad477e7c5f843e7d14dad02784fab4c540e8818e /app/policies | |
parent | b729b171981c6156164a1070c2b366f7d1986a1d (diff) | |
download | gitlab-ce-32dee03b2fec293a8581034301bab9d4a3f86d1a.tar.gz |
Improve pipeline triggers UI
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/ci/trigger_policy.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/policies/ci/trigger_policy.rb b/app/policies/ci/trigger_policy.rb new file mode 100644 index 00000000000..c90c9ac0583 --- /dev/null +++ b/app/policies/ci/trigger_policy.rb @@ -0,0 +1,13 @@ +module Ci + class TriggerPolicy < BasePolicy + def rules + delegate! @subject.project + + if can?(:admin_build) + can! :admin_trigger if @subject.owner.blank? || + @subject.owner == @user + can! :manage_trigger + end + end + end +end |