Module: ActionPolicy::GraphQL
- Defined in:
 - lib/action_policy/graphql.rb,
lib/action_policy/graphql/fields.rb,
lib/action_policy/graphql/version.rb,
lib/action_policy/graphql/behaviour.rb,
lib/action_policy/graphql/authorized_field.rb,
lib/action_policy/graphql/types/failure_reasons.rb,
lib/action_policy/graphql/types/authorization_result.rb 
Defined Under Namespace
Modules: AuthorizedField, Behaviour, Fields, Types
Constant Summary collapse
- VERSION =
 "0.5.4"
Class Attribute Summary collapse
- 
  
    
      .authorize_raise_exception  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Whether to raise an exeption if field is not authorized or return ‘nil`.
 - 
  
    
      .default_authorization_field_prefix  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Which prefix to use for authorization fields Defaults to ‘“can_”`.
 - 
  
    
      .default_authorize_rule  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Which rule to use when no specified (e.g. ‘authorize: true`) Defaults to `:show?`.
 - 
  
    
      .default_preauthorize_list_rule  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Which rule to use when no specified for preauthorization (e.g. ‘preauthorize: true`) of a list-like field.
 - 
  
    
      .default_preauthorize_node_rule  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Which rule to use when no specified for preauthorization (e.g. ‘preauthorize: true`) of a singleton-like field.
 - .preauthorize_mutation_raise_exception ⇒ Object
 - 
  
    
      .preauthorize_raise_exception  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Whether to raise an exception if preauthorization fails Equals to authorize_raise_exception unless explicitly set.
 
Class Attribute Details
.authorize_raise_exception ⇒ Object
Whether to raise an exeption if field is not authorized or return ‘nil`. Defaults to `true`.
      28 29 30  | 
    
      # File 'lib/action_policy/graphql.rb', line 28 def @authorize_raise_exception end  | 
  
.default_authorization_field_prefix ⇒ Object
Which prefix to use for authorization fields Defaults to ‘“can_”`
      32 33 34  | 
    
      # File 'lib/action_policy/graphql.rb', line 32 def @default_authorization_field_prefix end  | 
  
.default_authorize_rule ⇒ Object
Which rule to use when no specified (e.g. ‘authorize: true`) Defaults to `:show?`
      13 14 15  | 
    
      # File 'lib/action_policy/graphql.rb', line 13 def @default_authorize_rule end  | 
  
.default_preauthorize_list_rule ⇒ Object
Which rule to use when no specified for preauthorization (e.g. ‘preauthorize: true`) of a list-like field. Defaults to `:index?`
      18 19 20  | 
    
      # File 'lib/action_policy/graphql.rb', line 18 def @default_preauthorize_list_rule end  | 
  
.default_preauthorize_node_rule ⇒ Object
Which rule to use when no specified for preauthorization (e.g. ‘preauthorize: true`) of a singleton-like field. Defaults to `:show?`
      23 24 25  | 
    
      # File 'lib/action_policy/graphql.rb', line 23 def @default_preauthorize_node_rule end  | 
  
.preauthorize_mutation_raise_exception ⇒ Object
      47 48 49 50 51  | 
    
      # File 'lib/action_policy/graphql.rb', line 47 def return if @preauthorize_mutation_raise_exception.nil? @preauthorize_mutation_raise_exception end  | 
  
.preauthorize_raise_exception ⇒ Object
Whether to raise an exception if preauthorization fails Equals to authorize_raise_exception unless explicitly set
      38 39 40 41  | 
    
      # File 'lib/action_policy/graphql.rb', line 38 def return if @preauthorize_raise_exception.nil? @preauthorize_raise_exception end  |