Module: Authorization::HardwiredRoles::UserExtensions::InstanceMethods
- Defined in:
- lib/authorization/publishare/hardwired_roles.rb
Instance Method Summary collapse
- #has_no_role(role, authorizable_object = nil) ⇒ Object
- #has_role(role, authorizable_object = nil) ⇒ Object
-
#has_role?(role, authorizable_object = nil) ⇒ Boolean
If roles aren’t explicitly defined in user class then return false.
Instance Method Details
#has_no_role(role, authorizable_object = nil) ⇒ Object
41 42 43 44 45 |
# File 'lib/authorization/publishare/hardwired_roles.rb', line 41 def has_no_role( role, = nil ) raise( CannotSetRoleWhenHardwired, "Hardwired mixin: Cannot remove user role #{role}. Don't use #has_no_role, use code in models." ) end |
#has_role(role, authorizable_object = nil) ⇒ Object
35 36 37 38 39 |
# File 'lib/authorization/publishare/hardwired_roles.rb', line 35 def has_role( role, = nil ) raise( CannotSetRoleWhenHardwired, "Hardwired mixin: Cannot set user to role #{role}. Don't use #has_role, use code in models." ) end |
#has_role?(role, authorizable_object = nil) ⇒ Boolean
If roles aren’t explicitly defined in user class then return false
31 32 33 |
# File 'lib/authorization/publishare/hardwired_roles.rb', line 31 def has_role?( role, = nil ) false end |