Class: CanCanCan::NestedAssignmentAndAuthorization::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/cancancan/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/cancancan/configuration.rb', line 6

def initialize
  # Allows for stopping unauthorized actions without raising errors
  @silence_raised_errors = false
  # Auto-determine what action to auth on nested associations (:create, :update, :destroy)
  # - will use the action of the root object otherwise.
  @use_smart_nested_authorizations = true
  # Set to `true` if you're nesting parameter data under the resource_key
  # - i.e. params => {user: {email: 'test', name: 'fun'}}
  # Set to `false` if resource parameter data is direct in in params.
  # - i.e. params => {email: 'test', name: 'fun'}
  @use_resource_key_in_params = false
end

Instance Attribute Details

#silence_raised_errorsObject

Returns the value of attribute silence_raised_errors.



4
5
6
# File 'lib/cancancan/configuration.rb', line 4

def silence_raised_errors
  @silence_raised_errors
end

#use_resource_key_in_paramsObject

Returns the value of attribute use_resource_key_in_params.



4
5
6
# File 'lib/cancancan/configuration.rb', line 4

def use_resource_key_in_params
  @use_resource_key_in_params
end

#use_smart_nested_authorizationsObject

Returns the value of attribute use_smart_nested_authorizations.



4
5
6
# File 'lib/cancancan/configuration.rb', line 4

def use_smart_nested_authorizations
  @use_smart_nested_authorizations
end