Class AuthorizableUtil

java.lang.Object
com.adobe.granite.security.user.util.AuthorizableUtil

public class AuthorizableUtil extends Object
AuthorizableUtil...
  • Constructor Details

    • AuthorizableUtil

      public AuthorizableUtil()
  • Method Details

    • getProfile

      public static UserProperties getProfile(@Nonnull UserPropertiesManager userPropertiesManager, @Nonnull String authorizableId) throws RepositoryException
      Throws:
      RepositoryException
    • getName

      @Deprecated public static String getName(Authorizable authorizable) throws RepositoryException
      Deprecated.
      since AEM6.4 because it is not multiple profile aware. Please use getFormattedName(ResourceResolver, Authorizable)
      Utility to retrieve the name of an authorizable that takes deprecated user properties such as present in older versions if CQ into account.
      Parameters:
      authorizable - the authorizable
      Returns:
      the name of the specified authorizable
      Throws:
      RepositoryException - in case of a failure
    • getFormattedName

      public static String getFormattedName(ResourceResolver resolver, String userId)
      Utility to retrieve the formatted name of a user. Always use the faster getFormattedName(ResourceResolver, Authorizable) if possible.
      Parameters:
      resolver - Resource resolver to use to get the UserPropertiesManager
      userId - ID of the user to get the display name from
      Returns:
      User's display name or its id if an error occurred
    • getFormattedName

      public static String getFormattedName(ResourceResolver resolver, Authorizable authorizable)
      Utility to retrieve the formatted name of a user.
      Parameters:
      resolver - Resource resolver to use to get the UserPropertiesManager
      authorizable - the authorizable
      Returns:
      User's display name or its id if an error occurred
    • getFormattedName

      public static String getFormattedName(ResourceResolver resolver, String userId, String nameDisplayOrder)
      Utility to retrieve the formatted name of a user. Always use the faster getFormattedName(ResourceResolver, Authorizable, String) if possible.
      Parameters:
      resolver - Resource resolver to use to get the UserPropertiesManager
      userId - ID of the user to get the display name from
      nameDisplayOrder - Order of given, middle and family names. Western name order should be "givenName middleName familyName", Eastern name order should be "familyName givenName middleName".
      Returns:
      User's display name or its id if an error occurred
    • getFormattedName

      public static String getFormattedName(ResourceResolver resolver, Authorizable authorizable, String nameDisplayOrder)
      Utility to retrieve the formatted name of a user
      Parameters:
      resolver - Resource resolver to use to get the UserPropertiesManager
      authorizable - the authorizable
      nameDisplayOrder - Order of given, middle and family names. Western name order should be "givenName middleName familyName", Eastern name order should be "familyName givenName middleName".
      Returns:
      User's display name or its id if an error occurred