mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-13 14:46:05 +10:00
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Conflicts: app/controllers/admin/application_settings_controller.rb app/controllers/groups/group_members_controller.rb app/controllers/projects/deploy_keys_controller.rb app/controllers/projects/project_members_controller.rb app/models/concerns/mentionable.rb app/models/project.rb app/models/project_team.rb app/models/service.rb app/views/admin/application_settings/_form.html.haml app/views/admin/groups/show.html.haml app/views/groups/group_members/_new_group_member.html.haml config/initializers/1_settings.rb db/schema.rb lib/gitlab/reference_extractor.rb spec/lib/gitlab/reference_extractor_spec.rb
33 lines
582 B
Ruby
33 lines
582 B
Ruby
class Groups::ApplicationController < ApplicationController
|
|
|
|
private
|
|
|
|
def authorize_read_group!
|
|
unless @group and can?(current_user, :read_group, @group)
|
|
if current_user.nil?
|
|
return authenticate_user!
|
|
else
|
|
return render_404
|
|
end
|
|
end
|
|
end
|
|
|
|
def authorize_admin_group!
|
|
unless can?(current_user, :admin_group, group)
|
|
return render_404
|
|
end
|
|
end
|
|
|
|
def group
|
|
@group ||= Group.find_by(path: params[:group_id])
|
|
end
|
|
|
|
def determine_layout
|
|
if current_user
|
|
'group'
|
|
else
|
|
'public_group'
|
|
end
|
|
end
|
|
end
|