docs: @Override
      @RequestCache
      public boolean doesPrincipalHavePermission(
              IAuthorizationPrincipal principal,
              String owner,
              String activity,
              String target,
              IPermissionPolicy policy)
              throws AuthorizationException {
  
          final CacheKeyBuilder<Serializable, Serializable> cacheKeyBuilder =
                  CacheKey.builder(AuthorizationImpl.class.getName());
          final String username = principal.getKey();
          if (IPerson.class.equals(principal.getType())) {
              cacheKeyBuilder.addTag(UsernameTaggedCacheEntryPurger.createCacheEntryTag(username));
          }
          cacheKeyBuilder.addAll(
                  policy.getClass(), username, principal.getType(), owner, activity, target);
  
          final CacheKey key = cacheKeyBuilder.build();
  
          final Element element = this.doesPrincipalHavePermissionCache.get(key);
          if (element != null) {
              return (Boolean) element.getValue();
          }
  
          boolean rslt = false; // fail closed
  
          /*
           * Convert to (strongly-typed) Java objects based on interfaces in
           * o.j.p.permission before we make the actual check with IPermissionPolicy;
           * parameters that communicate something of the nature of the things they
           * represent helps us make the check(s) more intelligently.  This objects
           * were retro-fitted to IPermissionPolicy in uP 4.3;  perhaps we should do
           * the same to IAuthorizationService itself?
           */
          final IPermissionOwner ipOwner = permissionOwnerDao.getPermissionOwner(owner);
          final IPermissionActivity ipActivity =
                  permissionOwnerDao.getPermissionActivity(owner, activity);
          if (ipActivity != null) {
              final IPermissionTargetProvider targetProvider =
                      targetProviderRegistry.getTargetProvider(ipActivity.getTargetProviderKey());
              final IPermissionTarget ipTarget = targetProvider.getTarget(target);
              rslt =
                      policy.doesPrincipalHavePermission(
                              this, principal, ipOwner, ipActivity, ipTarget);
          } else {
              /*
               * This circumstance means that a piece of the fundamental Permissions data expected by
               * the code is missing in the database.  It normally happens when a newer version of the
               * uPortal code is run against an existing database, and a required data update was
               * overlooked.  This condition is not great, but probably not catastrophic;  it means
               * that no one will (or can) have the new permission.  This method returns false.
               *
               * Administrators, however, have permission to do anything, including this unknown
               * activity.  It's most common in uPortal for only Administrators to have access to
               * exotic activities, so in most cases this omission is a wash.
               *
               * We need to log a WARNing, but this method is invoked a lot, and we don't want to do
               * it incessantly.
               */
              final Long now = System.currentTimeMillis();
              final String missingDataTrackerKey = owner + ":" + activity;
              final Long lastLogMessageTime = missingDataLogTracker.get(missingDataTrackerKey);
              if (lastLogMessageTime == null
                      || lastLogMessageTime < now - MISSING_DATA_LOG_PERIOD_MILLIS) {
                  logger.warn(
                          "Activity '{}' is not defined for owner '{}';  only admins will be "
                                  + "able to access this function;  this warning usually means that expected data "
                                  + "was not imported",
                          activity,
                          owner);
                  missingDataLogTracker.put(missingDataTrackerKey, now);
              }
              // This pass becomes a check for superuser (Portal Administrators)
              rslt =
                      doesPrincipalHavePermission(
                              principal,
                              IPermission.PORTAL_SYSTEM,
                              IPermission.ALL_PERMISSIONS_ACTIVITY,
                              IPermission.ALL_TARGET,
                              policy);
          }
  
          this.doesPrincipalHavePermissionCache.put(new Element(key, rslt));
  
          return rslt;
      }