diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-11-06 22:20:44 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-11-06 22:20:44 +0900 |
commit | 9b58b8e363fd388635385085c58be3d4637eaa45 (patch) | |
tree | e348f8d2cf9030d59448cea3dbc459a29bbecf95 /app/policies | |
parent | d4ceec9d47a7da5fa17cb6e161ac491e13fcb8bd (diff) | |
download | gitlab-ce-9b58b8e363fd388635385085c58be3d4637eaa45.tar.gz |
Do not allow jobs to be erased
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/ci/build_policy.rb | 5 |
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 |