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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
8c639ac2
Commit
8c639ac2
authored
Dec 13, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport hooks on group policies for the EE-specific implementation
parent
0d04db92
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
app/policies/group_member_policy.rb
app/policies/group_member_policy.rb
+6
-0
app/policies/group_policy.rb
app/policies/group_policy.rb
+6
-0
No files found.
app/policies/group_member_policy.rb
View file @
8c639ac2
...
@@ -15,5 +15,11 @@ class GroupMemberPolicy < BasePolicy
...
@@ -15,5 +15,11 @@ class GroupMemberPolicy < BasePolicy
elsif
@user
==
target_user
elsif
@user
==
target_user
can!
:destroy_group_member
can!
:destroy_group_member
end
end
additional_rules!
end
def
additional_rules!
# This is meant to be overriden in EE
end
end
end
end
app/policies/group_policy.rb
View file @
8c639ac2
...
@@ -33,6 +33,8 @@ class GroupPolicy < BasePolicy
...
@@ -33,6 +33,8 @@ class GroupPolicy < BasePolicy
if
globally_viewable
&&
@subject
.
request_access_enabled
&&
!
member
if
globally_viewable
&&
@subject
.
request_access_enabled
&&
!
member
can!
:request_access
can!
:request_access
end
end
additional_rules!
(
master
)
end
end
def
can_read_group?
def
can_read_group?
...
@@ -43,4 +45,8 @@ class GroupPolicy < BasePolicy
...
@@ -43,4 +45,8 @@ class GroupPolicy < BasePolicy
GroupProjectsFinder
.
new
(
@subject
).
execute
(
@user
).
any?
GroupProjectsFinder
.
new
(
@subject
).
execute
(
@user
).
any?
end
end
def
additional_rules!
(
master
)
# This is meant to be overriden in EE
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