code: static void ensurePrincipalAccessIsAllowedForService(final ServiceTicket serviceTicket,
                                                           final AuthenticationResult context,
                                                           final RegisteredService registeredService)
          throws UnauthorizedServiceException, PrincipalException {
          ensurePrincipalAccessIsAllowedForService(serviceTicket.getService(), registeredService, context.getAuthentication());
      }
docs: Ensure service access is allowed.
  
  @param serviceTicket     the service ticket
  @param context           the context
  @param registeredService the registered service
  @throws UnauthorizedServiceException the unauthorized service exception
  @throws PrincipalException           the principal exception