Exception: Rbacan::NotAuthorized
- Inherits:
-
StandardError
- Object
- StandardError
- Rbacan::NotAuthorized
- Defined in:
- lib/rbacan/not_authorized.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#permission ⇒ Object
readonly
Returns the value of attribute permission.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
Instance Method Summary collapse
-
#initialize(message = nil, permission: nil, role: nil) ⇒ NotAuthorized
constructor
A new instance of NotAuthorized.
Constructor Details
#initialize(message = nil, permission: nil, role: nil) ⇒ NotAuthorized
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/rbacan/not_authorized.rb', line 5 def initialize( = nil, permission: nil, role: nil) = @role = role @code = if 'rbacan.not_authorized.permission' elsif role 'rbacan.not_authorized.role' else 'rbacan.not_authorized' end super( || ) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/rbacan/not_authorized.rb', line 3 def code @code end |
#permission ⇒ Object (readonly)
Returns the value of attribute permission.
3 4 5 |
# File 'lib/rbacan/not_authorized.rb', line 3 def end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
3 4 5 |
# File 'lib/rbacan/not_authorized.rb', line 3 def role @role end |