Added operate? admin? policy for navbar
This commit is contained in:
@@ -12,6 +12,14 @@ class ApplicationPolicy < ActionPolicy::Base
|
||||
deny! unless user.verified?
|
||||
end
|
||||
|
||||
def operate?
|
||||
allow! if user.operator? || user.admin?
|
||||
end
|
||||
|
||||
def admin?
|
||||
allow! if user.admin?
|
||||
end
|
||||
|
||||
# Configure additional authorization contexts here
|
||||
# (`user` is added by default).
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user