class KittyPolicy::GraphQL::FieldAuthorization
Public Class Methods
new(policy:, current_user_key: :current_user)
click to toggle source
# File lib/kitty_policy/graphql/field_authorization.rb, line 6 def initialize(policy:, current_user_key: :current_user) @policy = policy @current_user_key = current_user_key end
Public Instance Methods
instrument(_type, field)
click to toggle source
# File lib/kitty_policy/graphql/field_authorization.rb, line 11 def instrument(_type, field) return instrument_with_authorize(field) if field.metadata.key?(:authorize) return instrument_with_authorize_object(field) if field.metadata.key?(:authorize_object) field end