diff options
author | Stan Hu <stanhu@gmail.com> | 2017-12-05 23:36:49 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-12-12 15:07:24 -0800 |
commit | 87118872c94ab465d400090e247b1e4ae90c2d82 (patch) | |
tree | e1139ab70d1acdcd66e202421d404b68bf731d70 /app/policies | |
parent | bc2d32aca0be46250bd02c9312d1064df024b621 (diff) | |
download | gitlab-ce-87118872c94ab465d400090e247b1e4ae90c2d82.tar.gz |
Fix conditions for checking pipeline schedule rules
Diffstat (limited to 'app/policies')
-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 |