@Override
    public AuthorizationResult evaluate(final AuthorizableResource resource, final AuthorizationRequest request) throws Throwable {
        val applicationContext = ApplicationContextProvider.getApplicationContext();
        val cacheManager = ApplicationContextProvider.getScriptResourceCacheManager().orElseThrow();
        val key = DigestUtils.sha256(script);
        val scriptToExec = cacheManager.resolveScriptableResource(script, key);
        val args = Map.of("resource", resource, "request", request, "applicationContext", applicationContext, "logger", LOGGER);
        scriptToExec.setBinding(args);
        return scriptToExec.execute(args.values().toArray(), AuthorizationResult.class);
    }
This is {@link GroovyAuthorizationPolicy}.

@author Misagh Moayyed
@since 7.2.0
support/cas-server-support-heimdall/src/main/java/org/apereo/cas/heimdall/authorizer/resource/policy/GroovyAuthorizationPolicy.java