Exception: ActiveItem::AccessDeniedError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/active_item/errors.rb

Overview

Raised when an IAM policy denies a DynamoDB operation on a table.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model_name:, table:, operation:, original_error:) ⇒ AccessDeniedError

Returns a new instance of AccessDeniedError.



11
12
13
14
15
16
17
18
# File 'lib/active_item/errors.rb', line 11

def initialize(model_name:, table:, operation:, original_error:)
  @model_name = model_name
  @table = table
  @operation = operation
  @original_error = original_error
  super("#{model_name} is not allowed to #{operation} on #{table}. " \
        'Ensure the IAM role has access to this table.')
end

Instance Attribute Details

#model_nameObject (readonly)

Returns the value of attribute model_name.



9
10
11
# File 'lib/active_item/errors.rb', line 9

def model_name
  @model_name
end

#operationObject (readonly)

Returns the value of attribute operation.



9
10
11
# File 'lib/active_item/errors.rb', line 9

def operation
  @operation
end

#original_errorObject (readonly)

Returns the value of attribute original_error.



9
10
11
# File 'lib/active_item/errors.rb', line 9

def original_error
  @original_error
end

#tableObject (readonly)

Returns the value of attribute table.



9
10
11
# File 'lib/active_item/errors.rb', line 9

def table
  @table
end