Exception: Cornerstone::AccessDenied

Inherits:
StandardError
  • Object
show all
Defined in:
lib/cornerstone/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil) ⇒ AccessDenied

Returns a new instance of AccessDenied.



6
7
8
9
# File 'lib/cornerstone/exceptions.rb', line 6

def initialize(message = nil)
  @message = message
  @default_message = I18n.t(:"unauthorized.default", :default => "You are not authorized to access this page.")
end

Instance Attribute Details

#default_message=(value) ⇒ Object (writeonly)

Sets the attribute default_message

Parameters:

  • value

    the value to set the attribute default_message to.



4
5
6
# File 'lib/cornerstone/exceptions.rb', line 4

def default_message=(value)
  @default_message = value
end

Instance Method Details

#to_sObject



11
12
13
# File 'lib/cornerstone/exceptions.rb', line 11

def to_s
  @message || @default_message
end