diff options
author | Stan Hu <stanhu@gmail.com> | 2017-12-06 10:36:49 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-12-13 02:07:24 +0300 |
commit | 87118872c94ab465d400090e247b1e4ae90c2d82 (patch) | |
tree | e1139ab70d1acdcd66e202421d404b68bf731d70 /app/policies/ci | |
parent | bc2d32aca0be46250bd02c9312d1064df024b621 (diff) |
Fix conditions for checking pipeline schedule rules
Diffstat (limited to 'app/policies/ci')
-rw-r--r-- | app/policies/ci/pipeline_schedule_policy.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/policies/ci/pipeline_schedule_policy.rb b/app/policies/ci/pipeline_schedule_policy.rb index 8e7e129f135..c0a2bb963e9 100644 --- a/app/policies/ci/pipeline_schedule_policy.rb +++ b/app/policies/ci/pipeline_schedule_policy.rb @@ -6,11 +6,11 @@ module Ci access = ::Gitlab::UserAccess.new(@user, project: @subject.project) if @subject.project.repository.branch_exists?(@subject.ref) - access.can_update_branch?(@subject.ref) + !access.can_update_branch?(@subject.ref) elsif @subject.project.repository.tag_exists?(@subject.ref) - access.can_create_tag?(@subject.ref) + !access.can_create_tag?(@subject.ref) else - true + false end end |