docs: private IPermission[] primGetPermissionsForPrincipal(IAuthorizationPrincipal principal)
              throws AuthorizationException {
          if (!this.cachePermissions) {
              return getUncachedPermissionsForPrincipal(principal, null, null, null);
          }
  
          IPermissionSet ps = null;
          // Check the caching service for the Permissions first.
          ps = cacheGet(principal);
  
          if (ps == null)
              synchronized (principal) {
                  ps = cacheGet(principal);
                  if (ps == null) {
                      IPermission[] permissions =
                              getUncachedPermissionsForPrincipal(principal, null, null, null);
                      ps = new PermissionSetImpl(permissions, principal);
                      cacheAdd(ps);
                  }
              } // end synchronized
          return ps.getPermissions();
      }