Commit 1ed6d154 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Rename :user_cannot_update to :protected_ref

parent a27cf281
module Ci module Ci
class BuildPolicy < CommitStatusPolicy class BuildPolicy < CommitStatusPolicy
condition(:user_cannot_update) do condition(:protected_ref) do
access = ::Gitlab::UserAccess.new(@user, project: @subject.project) access = ::Gitlab::UserAccess.new(@user, project: @subject.project)
if @subject.tag? if @subject.tag?
...@@ -10,6 +10,6 @@ module Ci ...@@ -10,6 +10,6 @@ module Ci
end end
end end
rule { user_cannot_update }.prevent :update_build rule { protected_ref }.prevent :update_build
end end
end end
...@@ -2,7 +2,7 @@ module Ci ...@@ -2,7 +2,7 @@ module Ci
class PipelinePolicy < BasePolicy class PipelinePolicy < BasePolicy
delegate { @subject.project } delegate { @subject.project }
condition(:user_cannot_update) do condition(:protected_ref) do
access = ::Gitlab::UserAccess.new(@user, project: @subject.project) access = ::Gitlab::UserAccess.new(@user, project: @subject.project)
if @subject.tag? if @subject.tag?
...@@ -12,6 +12,6 @@ module Ci ...@@ -12,6 +12,6 @@ module Ci
end end
end end
rule { user_cannot_update }.prevent :update_pipeline rule { protected_ref }.prevent :update_pipeline
end end
end end
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