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
7fc6b5b6
Commit
7fc6b5b6
authored
Apr 12, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not inherit build policy in pipeline policy
parent
6c6bc400
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
app/policies/base_policy.rb
app/policies/base_policy.rb
+4
-0
app/policies/ci/pipeline_policy.rb
app/policies/ci/pipeline_policy.rb
+4
-1
No files found.
app/policies/base_policy.rb
View file @
7fc6b5b6
...
@@ -97,6 +97,10 @@ class BasePolicy
...
@@ -97,6 +97,10 @@ class BasePolicy
rules
rules
end
end
def
rules
raise
NotImplementedError
end
def
delegate!
(
new_subject
)
def
delegate!
(
new_subject
)
@rule_set
.
merge
(
Ability
.
allowed
(
@user
,
new_subject
))
@rule_set
.
merge
(
Ability
.
allowed
(
@user
,
new_subject
))
end
end
...
...
app/policies/ci/pipeline_policy.rb
View file @
7fc6b5b6
module
Ci
module
Ci
class
PipelinePolicy
<
BuildPolicy
class
PipelinePolicy
<
BasePolicy
def
rules
delegate!
@subject
.
project
end
end
end
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