Commit 0b38c3e0 authored by Valery Sizov's avatar Valery Sizov
Browse files

group controller refactoring

parent a3a26aaef66e
class Groups::ApplicationController < ApplicationController
private
def authorize_admin_group!
unless can?(current_user, :manage_group, group)
return render_404
end
end
end
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
......
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment