Class: Ibrain::Extentions::Roles

Inherits:
GraphQL::Schema::FieldExtension
  • Object
show all
Defined in:
app/graphql/ibrain/extentions/roles.rb

Instance Method Summary collapse

Instance Method Details

#after_resolve(object:, value:, **_rest) ⇒ Object



6
7
8
9
10
# File 'app/graphql/ibrain/extentions/roles.rb', line 6

def after_resolve(object:, value:, **_rest)
  raise IbrainErrors::PermissionError.new("You not have permission to access #{field&.name}") if is_invalid_role(object)

  value
end