mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-11 13:46:11 +10:00
# Conflicts: # app/controllers/groups/application_controller.rb # app/services/test_hook_service.rb # app/views/admin/groups/show.html.haml # app/views/groups/_settings_nav.html.haml # app/views/groups/show.html.haml # app/views/layouts/_head.html.haml # app/views/projects/_settings_nav.html.haml # db/schema.rb # features/project/project.feature # features/steps/project/project.rb
26 lines
497 B
Ruby
26 lines
497 B
Ruby
class Groups::ApplicationController < ApplicationController
|
|
layout 'group'
|
|
|
|
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
|
|
end
|