module AuthorizationNext::HardwiredRoles::UserExtensions::InstanceMethods

Public Instance Methods

has_no_role( role, authorizable_object = nil ) click to toggle source
# File lib/authorization_next/publishare/hardwired_roles.rb, line 41
def has_no_role( role, authorizable_object = 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 ) click to toggle source
# File lib/authorization_next/publishare/hardwired_roles.rb, line 35
def has_role( role, authorizable_object = 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 ) click to toggle source

If roles aren't explicitly defined in user class then return false

# File lib/authorization_next/publishare/hardwired_roles.rb, line 31
def has_role?( role, authorizable_object = nil )
  false
end