@Override
    public Optional<AcceptableUsagePolicyTerms> fetchPolicy(final RequestContext requestContext) {
        try {
            val principal = WebUtils.getAuthentication(requestContext).getPrincipal();
            val result = watchableScript.execute("fetch", AcceptableUsagePolicyTerms.class,
                requestContext, applicationContext, principal, LOGGER);
            return Optional.ofNullable(result);
        } catch (final Throwable e) {
            LoggingUtils.error(LOGGER, e);
        }
        return Optional.empty();
    }
This is {@link GroovyAcceptableUsagePolicyRepository}.

@author Misagh Moayyed
@since 6.1.0
support/cas-server-support-aup-core/src/main/java/org/apereo/cas/aup/GroovyAcceptableUsagePolicyRepository.java