BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
1ed6d154
Commit
1ed6d154
authored
Jul 18, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename :user_cannot_update to :protected_ref
parent
a27cf281
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
build_policy.rb
app/policies/ci/build_policy.rb
+2
-2
pipeline_policy.rb
app/policies/ci/pipeline_policy.rb
+2
-2
No files found.
app/policies/ci/build_policy.rb
View file @
1ed6d154
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
app/policies/ci/pipeline_policy.rb
View file @
1ed6d154
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment