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
1cfa5ed0
Commit
1cfa5ed0
authored
May 16, 2018
by
Dylan Griffith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor out duplication in runner_policy.rb
parent
983bc6b1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
app/policies/ci/runner_policy.rb
app/policies/ci/runner_policy.rb
+8
-4
No files found.
app/policies/ci/runner_policy.rb
View file @
1cfa5ed0
...
...
@@ -6,10 +6,14 @@ module Ci
condition
(
:owned_runner
)
{
@user
.
ci_owned_runners
.
exists?
(
@subject
.
id
)
}
rule
{
anonymous
}.
prevent_all
rule
{
admin
|
owned_runner
}.
enable
:assign_runner
rule
{
admin
|
owned_runner
}.
enable
:read_runner
rule
{
admin
|
owned_runner
}.
enable
:update_runner
rule
{
admin
|
owned_runner
}.
enable
:delete_runner
rule
{
admin
|
owned_runner
}.
policy
do
enable
:assign_runner
enable
:read_runner
enable
:update_runner
enable
:delete_runner
end
rule
{
~
admin
&
locked
}.
prevent
:assign_runner
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