Class: HasHelpers::Resolvers::Internal::Roles::List

Inherits:
Base
  • Object
show all
Defined in:
app/graphql/has_helpers/resolvers/internal/roles.rb

Instance Method Summary collapse

Methods included from ServiceTrust::GraphQL::Authorizable

#authorized?

Instance Method Details

#resolve(organization_id: nil) ⇒ Object



44
45
46
47
48
49
# File 'app/graphql/has_helpers/resolvers/internal/roles.rb', line 44

def resolve(organization_id: nil)
  ensure_server_mode!
  scope = ::HasHelpers::Role.all
  scope = scope.where(organization_id: organization_id) if organization_id.present?
  scope.to_a
end