Add access control in public section to users teams

This commit is contained in:
Andrey Kumanyaev 2013-01-23 00:58:44 +04:00 committed by Dmitriy Zaporozhets
parent dcea52203d
commit 7534154b44
3 changed files with 11 additions and 1 deletions

View file

@ -1,8 +1,15 @@
class Teams::ApplicationController < ApplicationController
before_filter :authorize_manage_user_team!
protected
def user_team
@user_team ||= UserTeam.find_by_path(params[:team_id])
end
def authorize_manage_user_team!
return access_denied! unless can?(current_user, :manage_user_team, user_team)
end
end