summaryrefslogtreecommitdiff
path: root/app/controllers/groups
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2015-03-12 17:08:48 +0200
committerValery Sizov <vsv2711@gmail.com>2015-03-12 17:08:48 +0200
commit0b38c3e04138984123592da78ad78c79fdeaec3d (patch)
tree5702c6a76a4492542ea84ca1d2dae21584413db3 /app/controllers/groups
parent3f823068e1f6e3e88d6631de60d9aaf9ecd5e6f9 (diff)
downloadgitlab-ce-0b38c3e04138984123592da78ad78c79fdeaec3d.tar.gz
group controller refactoring
Diffstat (limited to 'app/controllers/groups')
-rw-r--r--app/controllers/groups/application_controller.rb10
-rw-r--r--app/controllers/groups/group_members_controller.rb8
2 files changed, 11 insertions, 7 deletions
diff --git a/app/controllers/groups/application_controller.rb b/app/controllers/groups/application_controller.rb
new file mode 100644
index 00000000000..7f27f2bb734
--- /dev/null
+++ b/app/controllers/groups/application_controller.rb
@@ -0,0 +1,10 @@
+class Groups::ApplicationController < ApplicationController
+
+ private
+
+ def authorize_admin_group!
+ unless can?(current_user, :manage_group, group)
+ return render_404
+ end
+ end
+end
diff --git a/app/controllers/groups/group_members_controller.rb b/app/controllers/groups/group_members_controller.rb
index ca88d033878..b083cf5d8c5 100644
--- a/app/controllers/groups/group_members_controller.rb
+++ b/app/controllers/groups/group_members_controller.rb
@@ -1,4 +1,4 @@
-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