Exception: Authority::SecurityViolation
- Inherits:
-
StandardError
- Object
- StandardError
- Authority::SecurityViolation
- Defined in:
- lib/authority/security_violation.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.
5 6 7 8 9 |
# File 'lib/authority/security_violation.rb', line 5 def initialize(user, action, resource) @user = user @action = action @resource = resource end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
3 4 5 |
# File 'lib/authority/security_violation.rb', line 3 def action @action end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
3 4 5 |
# File 'lib/authority/security_violation.rb', line 3 def resource @resource end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
3 4 5 |
# File 'lib/authority/security_violation.rb', line 3 def user @user end |
Instance Method Details
#message ⇒ Object
11 12 13 |
# File 'lib/authority/security_violation.rb', line 11 def "#{@user} is not authorized to #{@action} this resource: #{@resource}" end |