Class AuthorizableUtil
- java.lang.Object
-
- com.adobe.granite.security.user.util.AuthorizableUtil
-
public class AuthorizableUtil extends java.lang.Object
AuthorizableUtil...
-
-
Constructor Summary
Constructors Constructor Description AuthorizableUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.lang.String
getFormattedName(ResourceResolver resolver, java.lang.String userId)
Utility to retrieve the formatted name of a user.static java.lang.String
getFormattedName(ResourceResolver resolver, java.lang.String userId, java.lang.String nameDisplayOrder)
Utility to retrieve the formatted name of a user.static java.lang.String
getFormattedName(ResourceResolver resolver, Authorizable authorizable)
Utility to retrieve the formatted name of a user.static java.lang.String
getFormattedName(ResourceResolver resolver, Authorizable authorizable, java.lang.String nameDisplayOrder)
Utility to retrieve the formatted name of a userstatic java.lang.String
getName(Authorizable authorizable)
Deprecated.since AEM6.4 because it is not multiple profile aware.static UserProperties
getProfile(UserPropertiesManager userPropertiesManager, java.lang.String authorizableId)
-
-
-
Method Detail
-
getProfile
public static UserProperties getProfile(@Nonnull UserPropertiesManager userPropertiesManager, @Nonnull java.lang.String authorizableId) throws RepositoryException
- Throws:
RepositoryException
-
getName
@Deprecated public static java.lang.String getName(Authorizable authorizable) throws RepositoryException
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
public static java.lang.String getFormattedName(ResourceResolver resolver, java.lang.String userId)
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 theUserPropertiesManager
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 java.lang.String getFormattedName(ResourceResolver resolver, Authorizable authorizable)
Utility to retrieve the formatted name of a user.- Parameters:
resolver
- Resource resolver to use to get theUserPropertiesManager
authorizable
- the authorizable- Returns:
- User's display name or its id if an error occurred
-
getFormattedName
public static java.lang.String getFormattedName(ResourceResolver resolver, java.lang.String userId, java.lang.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 theUserPropertiesManager
userId
- 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 java.lang.String getFormattedName(ResourceResolver resolver, Authorizable authorizable, java.lang.String nameDisplayOrder)
Utility to retrieve the formatted name of a user- Parameters:
resolver
- Resource resolver to use to get theUserPropertiesManager
authorizable
- 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
-
-