import { GraphQLFieldResolver } from "@webiny/handler-graphql/types" ; import { NotAuthorizedResponse } from "@webiny/api-security" ; import { I18NContentContext } from "./types" ; import hasPermission from "./utils/hasI18NContentPermission" ; export const hasI18NContentPermission = ( ) => { return ( resolver ) => { return async ( parent , args , context , info ) => { if ( await hasPermission ( context ) ) { return resolver ( parent , args , context , info ) ; } return new NotAuthorizedResponse ( ) ; } ; } ; } ;