Exception: Authoryze::AccessDenied
- Inherits:
-
StandardError
- Object
- StandardError
- Authoryze::AccessDenied
- Defined in:
- lib/authoryze/exceptions.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#default_message ⇒ Object
writeonly
Sets the attribute default_message.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
Instance Method Summary collapse
-
#initialize(message = nil, action = nil, subject = nil) ⇒ AccessDenied
constructor
A new instance of AccessDenied.
- #to_s ⇒ Object
Constructor Details
#initialize(message = nil, action = nil, subject = nil) ⇒ AccessDenied
Returns a new instance of AccessDenied.
6 7 8 9 10 11 |
# File 'lib/authoryze/exceptions.rb', line 6 def initialize( = nil, action = nil, subject = nil) @message = @action = action @subject = subject @default_message = I18n.t(:"unauthorized.default", :default => "You are not authorized to access this page.") end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
3 4 5 |
# File 'lib/authoryze/exceptions.rb', line 3 def action @action end |
#default_message=(value) ⇒ Object (writeonly)
Sets the attribute default_message
4 5 6 |
# File 'lib/authoryze/exceptions.rb', line 4 def (value) @default_message = value end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
3 4 5 |
# File 'lib/authoryze/exceptions.rb', line 3 def subject @subject end |
Instance Method Details
#to_s ⇒ Object
13 14 15 |
# File 'lib/authoryze/exceptions.rb', line 13 def to_s @message || @default_message end |