diff options
author | Francisco Javier López <fjlopez@gitlab.com> | 2018-07-05 16:55:10 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-07-05 16:55:10 +0300 |
commit | a7a1531fe5d030d47d63bfcd86a7168a8437ff86 (patch) | |
tree | 65854ce75eb6b6f6061fef114f95076fae2ab9a8 /app/policies | |
parent | 9a62e72db9892708ab360c59a9f77695d9253c34 (diff) |
Web Terminal Ci Build
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/ci/build_policy.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/policies/ci/build_policy.rb b/app/policies/ci/build_policy.rb index 1c0cc7425ec..75c7e529902 100644 --- a/app/policies/ci/build_policy.rb +++ b/app/policies/ci/build_policy.rb @@ -18,6 +18,10 @@ module Ci @subject.project.branch_allows_collaboration?(@user, @subject.ref) end + condition(:terminal, scope: :subject) do + @subject.has_terminal? + end + rule { protected_ref }.policy do prevent :update_build prevent :erase_build @@ -29,5 +33,7 @@ module Ci enable :update_build enable :update_commit_status end + + rule { can?(:update_build) & terminal }.enable :create_build_terminal end end |