Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
cc1abd9ecc76
Commit
0b38c3e0
authored
Mar 12, 2015
by
Valery Sizov
Browse files
group controller refactoring
parent
a3a26aaef66e
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/controllers/groups/application_controller.rb
0 → 100644
View file @
cc1abd9e
class
Groups::ApplicationController
<
ApplicationController
private
def
authorize_admin_group!
unless
can?
(
current_user
,
:manage_group
,
group
)
return
render_404
end
end
end
app/controllers/groups/group_members_controller.rb
View file @
cc1abd9e
class
Groups::GroupMembersController
<
ApplicationController
class
Groups::GroupMembersController
<
Groups
::
ApplicationController
before_filter
:group
# Authorize
...
...
@@ -37,12 +37,6 @@ def group
@group
||=
Group
.
find_by
(
path:
params
[
:group_id
])
end
def
authorize_admin_group!
unless
can?
(
current_user
,
:manage_group
,
group
)
return
render_404
end
end
def
member_params
params
.
require
(
:group_member
).
permit
(
:access_level
,
:user_id
)
end
...
...
app/controllers/groups_controller.rb
View file @
cc1abd9e
class
GroupsController
<
ApplicationController
class
GroupsController
<
Groups
::
ApplicationController
skip_before_filter
:authenticate_user!
,
only:
[
:show
,
:issues
,
:members
,
:merge_requests
]
respond_to
:html
before_filter
:group
,
except:
[
:new
,
:create
]
...
...
@@ -132,12 +132,6 @@ def authorize_create_group!
end
end
def
authorize_admin_group!
unless
can?
(
current_user
,
:manage_group
,
group
)
return
render_404
end
end
def
set_title
@title
=
'New 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