@Override
    public boolean submit(final RequestContext requestContext) {
        try {
            val principal = WebUtils.getAuthentication(requestContext).getPrincipal();
            val update = Update.update(aupProperties.getCore().getAupAttributeName(), Boolean.TRUE);
            val query = new Query(Criteria.where("username").is(principal.getId()));
            this.mongoTemplate.updateFirst(query, update, aupProperties.getMongo().getCollection());
            return true;
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
        }
        return false;
    }
This is {@link MongoDbAcceptableUsagePolicyRepository}.
Examines the principal attribute collection to determine if
the policy has been accepted, and if not, allows for a configurable
way so that user's choice can later be remembered and saved back into
the mongo instance.

@author Misagh Moayyed
@since 5.2
support/cas-server-support-aup-mongo/src/main/java/org/apereo/cas/aup/MongoDbAcceptableUsagePolicyRepository.java