Rename :user_cannot_update to :protected_ref

This commit is contained in:
Lin Jen-Shin 2017-07-18 22:13:57 +08:00
parent a27cf281b1
commit 1ed6d1541c
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
module Ci
class BuildPolicy < CommitStatusPolicy
condition(:user_cannot_update) do
condition(:protected_ref) do
access = ::Gitlab::UserAccess.new(@user, project: @subject.project)
if @subject.tag?
@ -10,6 +10,6 @@ module Ci
end
end
rule { user_cannot_update }.prevent :update_build
rule { protected_ref }.prevent :update_build
end
end

View File

@ -2,7 +2,7 @@ module Ci
class PipelinePolicy < BasePolicy
delegate { @subject.project }
condition(:user_cannot_update) do
condition(:protected_ref) do
access = ::Gitlab::UserAccess.new(@user, project: @subject.project)
if @subject.tag?
@ -12,6 +12,6 @@ module Ci
end
end
rule { user_cannot_update }.prevent :update_pipeline
rule { protected_ref }.prevent :update_pipeline
end
end