class CoreTokenResourceAuthzModule extends AdminOnlyAuthzModule {

    @Override
    protected Promise<AuthorizationResult, ResourceException> authorize(Context context) {

        if (!enabled) {
            if (debug.messageEnabled()) {
                debug.message("CoreTokenResourceAuthzModule :: Restricted access to CoreTokenResource");
            }
            return Promises.newResultPromise(AuthorizationResult.accessDenied("CoreTokenResource not enabled."));
        }

        if (debug.messageEnabled()) {
            debug.message("CoreTokenResourceAuthzModule :: Request forwarded to AdminOnlyAuthzModule.");
        }

        return super.authorize(context);
    }

    @Inject public  CoreTokenResourceAuthzModule(Config<SessionService> sessionService, Debug debug, boolean enabled);

}