Exception: ActiveAdmin::AccessDenied

Inherits:
StandardError
  • Object
show all
Defined in:
lib/active_admin/error.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

Instance Method Summary collapse

Constructor Details

#initialize(user, action, subject = nil) ⇒ AccessDenied

Returns a new instance of AccessDenied.



9
10
11
12
13
14
15
# File 'lib/active_admin/error.rb', line 9

def initialize(user, action, subject = nil)
  @user = user
  @action = action
  @subject = subject

  super()
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



7
8
9
# File 'lib/active_admin/error.rb', line 7

def action
  @action
end

#subjectObject (readonly)

Returns the value of attribute subject.



7
8
9
# File 'lib/active_admin/error.rb', line 7

def subject
  @subject
end

#userObject (readonly)

Returns the value of attribute user.



7
8
9
# File 'lib/active_admin/error.rb', line 7

def user
  @user
end

Instance Method Details

#messageObject



17
18
19
# File 'lib/active_admin/error.rb', line 17

def message
  I18n.t("active_admin.access_denied.message")
end