/**
 * GraphQL Resolver 를 실행하기 전에 권한을 확인하는 파일입니다.
 *  expressApp 에서 GraphQL Resolver 를 실행하기 전에 권한을 확인할 때 사용됩니다.
 *
 *  author BounceCode, Inc.
 *  packageDocumentation import { deny , allow , rule , shield , and , or , not } from 'graphql-shield' ; import { Context } from '../express' ; author BounceCode, Inc.
  const rules = { returns author BounceCode, Inc.
      isAuthorized : rule ( ) ( async ( parent , args , ctx , info ) => { return Boolean ( ctx . user ?. id ) ; } ) , returns author BounceCode, Inc.
      isAdmin : rule ( ) ( async ( parent , args , ctx , info ) => { return Boolean ( ctx . user ?. isAdmin ) ; } ) , isPublic : rule ( ) ( async ( parent , args , ctx , info ) => { return Boolean ( args . where . isPublic ) ; } ) , } ; /**
 * Resolver 에  rules 를 적용합니다.
 *
 *  author BounceCode, Inc.
  const ruleTree = { Query : { '*' : allow , } , Mutation : { '*' : allow , } , } ; /**
 *  ruleTree 를 바탕으로 권한을 설정합니다.
 *
 *  author BounceCode, Inc.
  const permissions = shield ( ruleTree ) ; export default permissions ;