Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
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
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
app/policies/ci/build_policy.rb
app/policies/ci/build_policy.rb
+2
-2
app/policies/ci/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