diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-07-18 11:31:29 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-07-18 11:42:13 +0300 |
commit | 7426e616e859671622cea96755cb5b1e09fd9abe (patch) | |
tree | f83c713abfa6c1f7b3b9b1e0e7af61d36e8f02b5 /app/policies/ci | |
parent | ef2e9879b9f4b730be2f950aa60db8b503f332b5 (diff) |
Make sure it checks against the tag only when it's a tag
Diffstat (limited to 'app/policies/ci')
-rw-r--r-- | app/policies/ci/build_policy.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/policies/ci/build_policy.rb b/app/policies/ci/build_policy.rb index 71ecb5bca8d..386822d3ff6 100644 --- a/app/policies/ci/build_policy.rb +++ b/app/policies/ci/build_policy.rb @@ -5,8 +5,11 @@ module Ci access = ::Gitlab::UserAccess.new(@user, project: @subject.project) - !access.can_merge_to_branch?(@subject.ref) || + if @subject.tag? !access.can_create_tag?(@subject.ref) + else + !access.can_merge_to_branch?(@subject.ref) + end end rule { protected_action }.prevent :update_build |