UNPKG

obrigado-react-admin-backend-utils

Version:
11 lines (9 loc) 257 B
import { AuthChecker } from 'type-graphql' export const authCheckerAdmin: AuthChecker<any> = ( { root, args, context, info }, roles ) => { if (!roles.includes('admin')) return false if (context.administrator) return true return false }