Class AuthorizableUtil
java.lang.Object
com.adobe.granite.security.user.util.AuthorizableUtil
AuthorizableUtil...
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetFormattedName(ResourceResolver resolver, String userId) Utility to retrieve the formatted name of a user.static StringgetFormattedName(ResourceResolver resolver, String userId, String nameDisplayOrder) Utility to retrieve the formatted name of a user.static StringgetFormattedName(ResourceResolver resolver, Authorizable authorizable) Utility to retrieve the formatted name of a user.static StringgetFormattedName(ResourceResolver resolver, Authorizable authorizable, String nameDisplayOrder) Utility to retrieve the formatted name of a userstatic StringgetName(Authorizable authorizable) Deprecated.since AEM6.4 because it is not multiple profile aware.static UserPropertiesgetProfile(UserPropertiesManager userPropertiesManager, String authorizableId)
-
Constructor Details
-
AuthorizableUtil
public AuthorizableUtil()
-
-
Method Details
-
getProfile
public static UserProperties getProfile(@Nonnull UserPropertiesManager userPropertiesManager, @Nonnull String authorizableId) throws RepositoryException - Throws:
RepositoryException
-
getName
Deprecated.since AEM6.4 because it is not multiple profile aware. Please usegetFormattedName(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
Utility to retrieve the formatted name of a user. Always use the fastergetFormattedName(ResourceResolver, Authorizable)if possible.- Parameters:
resolver- Resource resolver to use to get theUserPropertiesManageruserId- ID of the user to get the display name from- Returns:
- User's display name or its id if an error occurred
-
getFormattedName
Utility to retrieve the formatted name of a user.- Parameters:
resolver- Resource resolver to use to get theUserPropertiesManagerauthorizable- 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 fastergetFormattedName(ResourceResolver, Authorizable, String)if possible.- Parameters:
resolver- Resource resolver to use to get theUserPropertiesManageruserId- ID of the user to get the display name fromnameDisplayOrder- 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 theUserPropertiesManagerauthorizable- the authorizablenameDisplayOrder- 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
-