public interface NuxeoPrincipal extends Principal, Serializable
| Modifier and Type | Field and Description | 
|---|---|
static String | 
PREFIX  | 
static String | 
TRANSIENT_USER_FORMAT
Deprecated. 
 
since 10.3. 
 | 
static String | 
TRANSIENT_USER_PREFIX  | 
static String | 
TRANSIENT_USERNAME_UNIQUE_PROP
Property that defines if a transient username should be unique no matter what base username is provided, or if a
 transient username should be always the same for a given base username. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
static String | 
computeTransientUsername(String baseUsername)
Computes a transient username from the given  
baseUsername. | 
String | 
getActingUser()
Gets the acting user for this principal. 
 | 
List<String> | 
getAllGroups()
Gets the groups this principal directly or undirectly is member of. 
 | 
String | 
getCompany()
Gets the company name of this principal. 
 | 
String | 
getEmail()
Get the user email if any. 
 | 
String | 
getFirstName()
Gets the first name of this principal. 
 | 
List<String> | 
getGroups()
Gets the groups this principal is directly member of. 
 | 
String | 
getLastName()
Gets the last name of this principal. 
 | 
DocumentModel | 
getModel()  | 
String | 
getOriginatingUser()
Gets the base user from which this principal was created, or  
null if this principal was not created from
 another user. | 
String | 
getPassword()
Gets the password of this principal. 
 | 
String | 
getPrincipalId()
Returns a generated id that is unique for each principal instance. 
 | 
List<String> | 
getRoles()
Gets the roles for this principal. 
 | 
String | 
getTenantId()
Returns the  
tenantId of this , or null if there is no tenantId. | 
boolean | 
isAdministrator()
Returns true if the principal is an administrator. 
 | 
boolean | 
isAnonymous()
Checks if the principal is anonymous (guest user). 
 | 
boolean | 
isMemberOf(String group)
Recursively test if the user is member of this group. 
 | 
boolean | 
isTransient()
Returns true if the principal is a transient principal. 
 | 
static boolean | 
isTransientUsername(String username)
Returns true if the given @{code username} is a transient username. 
 | 
void | 
setCompany(String company)  | 
void | 
setEmail(String email)  | 
void | 
setFirstName(String firstName)  | 
void | 
setGroups(List<String> groups)  | 
void | 
setLastName(String lastName)  | 
void | 
setModel(DocumentModel model)  | 
void | 
setName(String name)  | 
void | 
setOriginatingUser(String originatingUser)
Sets the originating user. 
 | 
void | 
setPassword(String password)  | 
void | 
setPrincipalId(String principalId)
Sets the principalId. 
 | 
void | 
setRoles(List<String> roles)  | 
static final String PREFIX
static final String TRANSIENT_USER_PREFIX
@Deprecated static final String TRANSIENT_USER_FORMAT
static final String TRANSIENT_USERNAME_UNIQUE_PROP
String getFirstName()
String getLastName()
String getPassword()
Note: Some APIs that return principals from the database intentionally do not fill this field
String getCompany()
String getEmail()
List<String> getGroups()
List<String> getAllGroups()
boolean isMemberOf(String group)
group - The name of the groupvoid setFirstName(String firstName)
void setLastName(String lastName)
void setCompany(String company)
void setPassword(String password)
String getPrincipalId()
void setPrincipalId(String principalId)
principalId - a new principalId for this instanceDocumentModel getModel()
void setModel(DocumentModel model)
boolean isAdministrator()
Security checks still apply on the repository for administrator user. If user is a system user, this method will return true.
String getTenantId()
tenantId of this , or null if there is no tenantId.boolean isAnonymous()
String getOriginatingUser()
null if this principal was not created from
 another user.nullvoid setOriginatingUser(String originatingUser)
originatingUser - the originating userString getActingUser()
This is the originating user (usually when this principal is a system user), or if there is none this principal's user.
boolean isTransient()
static boolean isTransientUsername(String username)
static String computeTransientUsername(String baseUsername)
baseUsername.
 
 If the configuration property "nuxeo.transient.username.unique" is true, the transient username
 will be unique, otherwise it will always be the same for a given baseUsername.
Copyright © 2019 Nuxeo. All rights reserved.