Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-07-18 17:13:57 +0300
committerLin Jen-Shin <godfat@godfat.org>2017-07-18 17:13:57 +0300
commit1ed6d1541c7973c08cdd4c1906ddcc0c3db893e3 (patch)
treea224537101857d7a56327ef53e716c6e470736e5 /app/policies/ci
parenta27cf281b17641f3f33712633099369867415309 (diff)
Rename :user_cannot_update to :protected_ref
Diffstat (limited to 'app/policies/ci')
-rw-r--r--app/policies/ci/build_policy.rb4
-rw-r--r--app/policies/ci/pipeline_policy.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/app/policies/ci/build_policy.rb b/app/policies/ci/build_policy.rb
index 00f18d0155b..984e5482288 100644
--- a/app/policies/ci/build_policy.rb
+++ b/app/policies/ci/build_policy.rb
@@ -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
diff --git a/app/policies/ci/pipeline_policy.rb b/app/policies/ci/pipeline_policy.rb
index 07d724c9cfd..4e689a9efd5 100644
--- a/app/policies/ci/pipeline_policy.rb
+++ b/app/policies/ci/pipeline_policy.rb
@@ -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