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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
0b38c3e0
Commit
0b38c3e0
authored
Mar 12, 2015
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
group controller refactoring
parent
3f823068
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
14 deletions
+12
-14
app/controllers/groups/application_controller.rb
app/controllers/groups/application_controller.rb
+10
-0
app/controllers/groups/group_members_controller.rb
app/controllers/groups/group_members_controller.rb
+1
-7
app/controllers/groups_controller.rb
app/controllers/groups_controller.rb
+1
-7
No files found.
app/controllers/groups/application_controller.rb
0 → 100644
View file @
0b38c3e0
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 @
0b38c3e0
class
Groups::GroupMembersController
<
ApplicationController
class
Groups::GroupMembersController
<
Groups
::
ApplicationController
before_filter
:group
# Authorize
...
...
@@ -37,12 +37,6 @@ class Groups::GroupMembersController < ApplicationController
@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 @
0b38c3e0
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 @@ class GroupsController < ApplicationController
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