BigW Consortium Gitlab

Commit 87118872 by Stan Hu

Fix conditions for checking pipeline schedule rules

parent bc2d32ac
......@@ -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
......
......@@ -27,7 +27,7 @@
%td
.pull-right.btn-group
- if can?(current_user, :play_pipeline_schedule, pipeline_schedule)
= link_to run_pipeline_schedule_path(pipeline_schedule), method: :post, title: s_('Play'), class: 'btn' do
= link_to play_pipeline_schedule_path(pipeline_schedule), method: :post, title: s_('Play'), class: 'btn' do
= icon('play')
- if can?(current_user, :update_pipeline_schedule, pipeline_schedule)
= link_to take_ownership_pipeline_schedule_path(pipeline_schedule), method: :post, title: s_('PipelineSchedules|Take ownership'), class: 'btn' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment