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
09286109
Commit
09286109
authored
Aug 16, 2016
by
http://jneen.net/
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add and use MergeRequestPolicy
parent
4d904bf3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
app/models/ability.rb
app/models/ability.rb
+5
-2
app/policies/merge_request_policy.rb
app/policies/merge_request_policy.rb
+3
-0
No files found.
app/models/ability.rb
View file @
09286109
...
@@ -70,13 +70,14 @@ class Ability
...
@@ -70,13 +70,14 @@ class Ability
def
abilities_by_subject_class
(
user
:,
subject
:)
def
abilities_by_subject_class
(
user
:,
subject
:)
case
subject
case
subject
when
CommitStatus
then
commit_status_abilities
(
user
,
subject
)
when
Project
then
ProjectPolicy
.
abilities
(
user
,
subject
)
when
Project
then
ProjectPolicy
.
abilities
(
user
,
subject
)
when
Issue
then
IssuePolicy
.
abilities
(
user
,
subject
)
when
Issue
then
IssuePolicy
.
abilities
(
user
,
subject
)
when
MergeRequest
then
MergeRequestPolicy
.
abilities
(
user
,
subject
)
when
CommitStatus
then
commit_status_abilities
(
user
,
subject
)
when
Note
then
note_abilities
(
user
,
subject
)
when
Note
then
note_abilities
(
user
,
subject
)
when
ProjectSnippet
then
project_snippet_abilities
(
user
,
subject
)
when
ProjectSnippet
then
project_snippet_abilities
(
user
,
subject
)
when
PersonalSnippet
then
personal_snippet_abilities
(
user
,
subject
)
when
PersonalSnippet
then
personal_snippet_abilities
(
user
,
subject
)
when
MergeRequest
then
merge_request_abilities
(
user
,
subject
)
when
Group
then
group_abilities
(
user
,
subject
)
when
Group
then
group_abilities
(
user
,
subject
)
when
Namespace
then
namespace_abilities
(
user
,
subject
)
when
Namespace
then
namespace_abilities
(
user
,
subject
)
when
GroupMember
then
group_member_abilities
(
user
,
subject
)
when
GroupMember
then
group_member_abilities
(
user
,
subject
)
...
@@ -100,6 +101,8 @@ class Ability
...
@@ -100,6 +101,8 @@ class Ability
ProjectPolicy
.
abilities
(
nil
,
subject
)
ProjectPolicy
.
abilities
(
nil
,
subject
)
elsif
subject
.
is_a?
(
Issue
)
elsif
subject
.
is_a?
(
Issue
)
IssuePolicy
.
abilities
(
nil
,
subject
)
IssuePolicy
.
abilities
(
nil
,
subject
)
elsif
subject
.
is_a?
(
MergeRequest
)
MergeRequestPolicy
.
abilities
(
nil
,
subject
)
elsif
subject
.
respond_to?
(
:project
)
elsif
subject
.
respond_to?
(
:project
)
ProjectPolicy
.
abilities
(
nil
,
subject
.
project
)
ProjectPolicy
.
abilities
(
nil
,
subject
.
project
)
elsif
subject
.
is_a?
(
Group
)
||
subject
.
respond_to?
(
:group
)
elsif
subject
.
is_a?
(
Group
)
||
subject
.
respond_to?
(
:group
)
...
...
app/policies/merge_request_policy.rb
0 → 100644
View file @
09286109
class
MergeRequestPolicy
<
IssuablePolicy
# pass
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