import { AuthorizationPlugin } from "@webiny/api-security/plugins/AuthorizationPlugin" ; import { CmsContext } from "~/types" ; export class InternalAuthorizationPlugin extends AuthorizationPlugin { private _identityType : string ; constructor ( identityType ) { super ( ) ; this . _identityType = identityType ; } getPermissions ( context ) { const identity = context . security . getIdentity ( ) ; if ( ! identity || identity . type !== this . _identityType ) { return ; } return identity . permissions ; } }