public static void verifyDateTimeRestrictions(Restrictable restrictable) throws GuacamoleException {
        
        String afterTimeString = restrictable.getAttributes().get(Restrictable.RESTRICT_TIME_AFTER_ATTRIBUTE_NAME);
        String beforeTimeString = restrictable.getAttributes().get(Restrictable.RESTRICT_TIME_BEFORE_ATTRIBUTE_NAME);
        RestrictionType dateRestriction = allowedByDateTimeRestrictions(afterTimeString, beforeTimeString);
        if (!dateRestriction.isAllowed())
            throw new TranslatableGuacamoleSecurityException(
                    "Use of this connection or connection group is not allowed at this time.",
                    "RESTRICT.ERROR_CONNECTION_NOT_ALLOWED_NOW"
            );
    }
Verifies the time restrictions for this extension and whether or not the
account should be allowed to be logged in to Guacamole at the current
day and time, throwing an exception if any of the restrictions result
in a violation of the time constraints of the account.

@param context
    The UserContext of the user whose access to Guacamole is being
    checked.

@param effectiveUserGroups
    The set of identifiers of groups of which the user who is being
    verified is a member.

@throws GuacamoleException 
    If any of the time constraints configured for the user result in the
    user not being allowed to be logged in to Guacamole, or if errors
    occur trying to retrieve permissions or attributes.
extensions/guacamole-auth-restrict/src/main/java/org/apache/guacamole/auth/restrict/RestrictionVerificationService.java