Renamed check_global_rights to check_global_access.

This commit is contained in:
George Vinogradov 2011-10-28 21:55:10 +04:00
parent bb4343d6ce
commit 8d9f63ae39
1 changed files with 6 additions and 2 deletions

View File

@ -7,10 +7,14 @@ class ActionController::Base
current_user.can_perform? c, a, target
end
def check_global_rights
def check_global_access
unless can_perform?
flash[:notice] = t('layout.not_access')
if request.env['HTTP_REFERER']
redirect_to(:back)
else
redirect_to(:root)
end
end
end