Exception: Authority::SecurityViolation
- Inherits:
-
StandardError
- Object
- StandardError
- Authority::SecurityViolation
- Defined in:
- lib/authority.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(user, action, resource) ⇒ SecurityViolation
constructor
A new instance of SecurityViolation.
- #message ⇒ Object
Constructor Details
#initialize(user, action, resource) ⇒ SecurityViolation
Returns a new instance of SecurityViolation.
62 63 64 65 66 |
# File 'lib/authority.rb', line 62 def initialize(user, action, resource) @user = user @action = action @resource = resource end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
60 61 62 |
# File 'lib/authority.rb', line 60 def action @action end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
60 61 62 |
# File 'lib/authority.rb', line 60 def resource @resource end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
60 61 62 |
# File 'lib/authority.rb', line 60 def user @user end |
Instance Method Details
#message ⇒ Object
68 69 70 |
# File 'lib/authority.rb', line 68 def "#{@user} is not authorized to #{@action} this resource: #{@resource}" end |