summaryrefslogtreecommitdiff
path: root/app/policies/ci
diff options
context:
space:
mode:
Diffstat (limited to 'app/policies/ci')
-rw-r--r--app/policies/ci/build_policy.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/policies/ci/build_policy.rb b/app/policies/ci/build_policy.rb
index 984e5482288..f158cda2f0e 100644
--- a/app/policies/ci/build_policy.rb
+++ b/app/policies/ci/build_policy.rb
@@ -10,6 +10,11 @@ module Ci
end
end
+ condition(:owner_of_build) do
+ can?(:developer_access) && @subject.owned_by?(@user)
+ end
+
rule { protected_ref }.prevent :update_build
+ rule { can?(:master_access) | owner_of_build }.enable :erase_build
end
end