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

Rename :user_cannot_update to :protected_ref

parent a27cf281
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
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