code: private static boolean isTenant(@NotNull ResourceResolver resourceResolver) {
      Tenant tenant = resourceResolver.adaptTo(Tenant.class);
      return tenant != null;
    }
docs: Checks if a tenant is active for the current user.
  @param resourceResolver Resource resolver
  @return true if tenant is active