Exception: Kadmin::Errors::Authorization

Inherits:
Kadmin::Error
  • Object
show all
Defined in:
lib/kadmin/errors/authorization.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource, user, reason) ⇒ Authorization

Returns a new instance of Authorization.



6
7
8
9
10
11
12
# File 'lib/kadmin/errors/authorization.rb', line 6

def initialize(resource, user, reason)
  @resource = resource
  @user = user
  @reason = reason

  super("#{@user} is unauthorized to access #{@resource} => #{@reason}")
end

Instance Attribute Details

#reasonObject (readonly)

Returns the value of attribute reason.



4
5
6
# File 'lib/kadmin/errors/authorization.rb', line 4

def reason
  @reason
end

#resourceObject (readonly)

Returns the value of attribute resource.



4
5
6
# File 'lib/kadmin/errors/authorization.rb', line 4

def resource
  @resource
end

#userObject (readonly)

Returns the value of attribute user.



4
5
6
# File 'lib/kadmin/errors/authorization.rb', line 4

def user
  @user
end