Implement role authorization

This commit is contained in:
Stella Rouzi 2014-08-12 11:51:59 +03:00
parent 6755328c4c
commit e2fb434dc7
122 changed files with 1386 additions and 751 deletions

View file

@ -137,14 +137,6 @@ module ApplicationHelper
render "shared/dynamic_association", association_name: association_name, title: title, f: form_builder, hint: options[:hint]
end
def has_role?(current_user, role)
if current_user.nil?
return false
end
return !!current_user.role?(role.to_s.camelize)
end
# Same as redirect_to(:back) if there is a valid HTTP referer, otherwise redirect_to()
def redirect_back_or_to(options = {}, response_status = {})
if request.env["HTTP_REFERER"]