Exception: Bali::AuthorizationError

Inherits:
Error
  • Object
show all
Defined in:
lib/bali/foundations/exceptions/authorization_error.rb

Overview

Error that will be raised when subtarget cannot do something he wanted to do, or when subtarget do something he should not be allowed to do.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#auth_levelObject

Returns the value of attribute auth_level.



5
6
7
# File 'lib/bali/foundations/exceptions/authorization_error.rb', line 5

def auth_level
  @auth_level
end

#operationObject

Returns the value of attribute operation.



4
5
6
# File 'lib/bali/foundations/exceptions/authorization_error.rb', line 4

def operation
  @operation
end

#roleObject

Returns the value of attribute role.



6
7
8
# File 'lib/bali/foundations/exceptions/authorization_error.rb', line 6

def role
  @role
end

#subtargetObject

it may be nil, depends on whether rule checking is using symbol/user



9
10
11
# File 'lib/bali/foundations/exceptions/authorization_error.rb', line 9

def subtarget
  @subtarget
end

#targetObject

whether a class or an object



12
13
14
# File 'lib/bali/foundations/exceptions/authorization_error.rb', line 12

def target
  @target
end

Instance Method Details

#to_sObject



14
15
16
# File 'lib/bali/foundations/exceptions/authorization_error.rb', line 14

def to_s
  "Role #{role} is performing #{operation} using precedence #{auth_level}"
end