mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Implement role authorization
This commit is contained in:
parent
6755328c4c
commit
e2fb434dc7
122 changed files with 1386 additions and 751 deletions
|
|
@ -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"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue