Sha256: b042f71d03c80d4b86c5560d36564b5263ac84dd48d0bb5bff7daf5079f5f6cc
Contents?: true
Size: 565 Bytes
Versions: 12
Compression:
Stored size: 565 Bytes
Contents
# frozen_string_literal: true module Osso module GraphQL module Resolvers class EnterpriseAccount < ::GraphQL::Schema::Resolver type Types::EnterpriseAccount, null: false def resolve(args) return unless admin? || enterprise_authorized?(args[:domain]) Osso::Models::EnterpriseAccount.find_by(domain: args[:domain]) end def admin? context[:scope] == :admin end def enterprise_authorized?(domain) context[:scope] == domain end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems