mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-12 06:06:05 +10:00
Conflicts: Gemfile.lock app/controllers/admin/application_settings_controller.rb app/controllers/groups/application_controller.rb app/controllers/groups/group_members_controller.rb app/controllers/projects/team_members_controller.rb app/helpers/application_settings_helper.rb app/helpers/projects_helper.rb app/helpers/tab_helper.rb app/models/application_setting.rb app/models/user.rb app/views/devise/shared/_signin_box.html.haml app/views/groups/projects.html.haml app/views/profiles/keys/_key.html.haml app/views/projects/team_members/_form.html.haml app/views/projects/team_members/index.html.haml config/routes.rb db/schema.rb spec/lib/gitlab/ldap/access_spec.rb
33 lines
583 B
Ruby
33 lines
583 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, :manage_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
|