Class: Yes::Auth::Principals::Role
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Yes::Auth::Principals::Role
- Defined in:
- lib/yes/auth/principals/role.rb
Overview
Represents an authorization role that can be assigned to users and resource accesses.
Constant Summary collapse
- SUPER_ADMIN_ROLE_NAME =
'admin'
Class Method Summary collapse
-
.super_admin_role ⇒ Yes::Auth::Principals::Role?
The super admin role.
Instance Method Summary collapse
-
#resource_authorization_name ⇒ String?
The role name with colons replaced by underscores.
Class Method Details
.super_admin_role ⇒ Yes::Auth::Principals::Role?
Returns the super admin role.
30 31 32 |
# File 'lib/yes/auth/principals/role.rb', line 30 def self.super_admin_role find_by(name: SUPER_ADMIN_ROLE_NAME) end |
Instance Method Details
#resource_authorization_name ⇒ String?
Returns the role name with colons replaced by underscores.
25 26 27 |
# File 'lib/yes/auth/principals/role.rb', line 25 def name&.tr(':', '_') end |