Rename :user_cannot_update to :protected_ref
This commit is contained in:
parent
a27cf281b1
commit
1ed6d1541c
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue