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
547d5f8f
Commit
547d5f8f
authored
Dec 12, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move EE code on Groups::GroupMembersController to EE namespace
parent
c6dab662
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
18 deletions
+33
-18
app/controllers/ee/groups/group_members_controller.rb
app/controllers/ee/groups/group_members_controller.rb
+31
-0
app/controllers/groups/group_members_controller.rb
app/controllers/groups/group_members_controller.rb
+2
-18
No files found.
app/controllers/ee/groups/group_members_controller.rb
0 → 100644
View file @
547d5f8f
module
EE
module
Groups
module
GroupMembersController
def
override
@group_member
=
@group
.
group_members
.
find
(
params
[
:id
])
return
render_403
unless
can?
(
current_user
,
:override_group_member
,
@group_member
)
if
@group_member
.
update_attributes
(
override_params
)
log_audit_event
(
@group_member
,
action: :override
)
respond_to
do
|
format
|
format
.
js
{
head
:ok
}
end
end
end
protected
def
authorize_update_group_member!
unless
can?
(
current_user
,
:admin_group_member
,
group
)
||
can?
(
current_user
,
:override_group_member
,
group
)
render_403
end
end
def
override_params
params
.
require
(
:group_member
).
permit
(
:override
)
end
end
end
end
app/controllers/groups/group_members_controller.rb
View file @
547d5f8f
class
Groups::GroupMembersController
<
Groups
::
ApplicationController
prepend
EE
::
Groups
::
GroupMembersController
include
MembershipActions
# Authorize
...
...
@@ -79,20 +81,6 @@ class Groups::GroupMembersController < Groups::ApplicationController
end
end
def
override
@group_member
=
@group
.
group_members
.
find
(
params
[
:id
])
return
render_403
unless
can?
(
current_user
,
:override_group_member
,
@group_member
)
if
@group_member
.
update_attributes
(
override_params
)
log_audit_event
(
@group_member
,
action: :override
)
respond_to
do
|
format
|
format
.
js
{
head
:ok
}
end
end
end
protected
def
authorize_update_group_member!
...
...
@@ -105,10 +93,6 @@ class Groups::GroupMembersController < Groups::ApplicationController
params
.
require
(
:group_member
).
permit
(
:access_level
,
:user_id
,
:expires_at
)
end
def
override_params
params
.
require
(
:group_member
).
permit
(
:override
)
end
# MembershipActions concern
alias_method
:membershipable
,
:group
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