debian-mirror-gitlab/app/controllers/groups/application_controller.rb

28 lines
563 B
Ruby
Raw Normal View History

2015-04-26 12:48:37 +05:30
class Groups::ApplicationController < ApplicationController
2015-09-11 14:41:01 +05:30
layout 'group'
2015-04-26 12:48:37 +05:30
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
2015-09-11 14:41:01 +05:30
def authorize_admin_group_member!
unless can?(current_user, :admin_group_member, group)
return render_403
2015-04-26 12:48:37 +05:30
end
end
end