Exception: Uploader::AccessDenied
- Inherits:
-
StandardError
- Object
- StandardError
- Uploader::AccessDenied
- Defined in:
- lib/uploader.rb
Overview
Exception class to raise when there is an authorized access exception thrown. The exception has a few goodies that may be useful for capturing / recognizing security issues.
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(user, action, subject = nil) ⇒ AccessDenied
constructor
A new instance of AccessDenied.
- #message ⇒ Object
Constructor Details
#initialize(user, action, subject = nil) ⇒ AccessDenied
Returns a new instance of AccessDenied.
79 80 81 82 83 84 85 |
# File 'lib/uploader.rb', line 79 def initialize(user, action, subject = nil) @user = user @action = action @subject = subject super() end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
77 78 79 |
# File 'lib/uploader.rb', line 77 def action @action end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
77 78 79 |
# File 'lib/uploader.rb', line 77 def subject @subject end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
77 78 79 |
# File 'lib/uploader.rb', line 77 def user @user end |
Instance Method Details
#message ⇒ Object
87 88 89 |
# File 'lib/uploader.rb', line 87 def I18n.t('uploader.access_denied.message') end |