Module: Rails::GraphQL::Field::AuthorizedField
- Included in:
- OutputField
- Defined in:
- lib/rails/graphql/field/authorized_field.rb
Overview
This provides ways for fields to be authorized, giving a logical level for enabling or disabling access to a field. It has a similar structure to events, but has a different hierarchy of resolution
Defined Under Namespace
Modules: Proxied
Instance Method Summary collapse
-
#authorizable? ⇒ Boolean
Checks if the field should go through an authorization process.
-
#authorize(*args, **xargs, &block) ⇒ Object
Add either settings for authorization or a block to be executed.
-
#authorizer ⇒ Object
Return the settings for the authorize process.
Instance Method Details
#authorizable? ⇒ Boolean
Checks if the field should go through an authorization process
32 33 34 |
# File 'lib/rails/graphql/field/authorized_field.rb', line 32 def defined?(@authorizer) end |
#authorize(*args, **xargs, &block) ⇒ Object
Add either settings for authorization or a block to be executed. It returns self
for chain purposes
21 22 23 24 |
# File 'lib/rails/graphql/field/authorized_field.rb', line 21 def (*args, **xargs, &block) @authorizer = [args, xargs, block] self end |
#authorizer ⇒ Object
Return the settings for the authorize process
27 28 29 |
# File 'lib/rails/graphql/field/authorized_field.rb', line 27 def @authorizer if end |