public class NuxeoPrincipalImpl extends Object implements NuxeoPrincipal
| Modifier and Type | Class and Description | 
|---|---|
protected static class  | 
NuxeoPrincipalImpl.TransferableClone
Provides another implementation which marshall the user id instead of transferring the whole content and resolve
 it when unmarshalled. 
 | 
| Modifier and Type | Field and Description | 
|---|---|
List<String> | 
allGroups  | 
protected UserConfig | 
config  | 
DataModel | 
dataModel  | 
boolean | 
isAdministrator  | 
boolean | 
isAnonymous  | 
DocumentModel | 
model  | 
String | 
origUserName  | 
String | 
principalId  | 
List<String> | 
roles  | 
List<String> | 
virtualGroups  | 
PREFIX, TRANSIENT_USER_FORMAT, TRANSIENT_USER_PREFIX, TRANSIENT_USERNAME_UNIQUE_PROP| Modifier | Constructor and Description | 
|---|---|
protected  | 
NuxeoPrincipalImpl(NuxeoPrincipalImpl other)  | 
  | 
NuxeoPrincipalImpl(String name)
Constructor that sets principal to not anonymous, not administrator, and updates all the principal groups. 
 | 
  | 
NuxeoPrincipalImpl(String name,
                  boolean isAnonymous)
Constructor that sets principal to not administrator, and updates all the principal groups. 
 | 
  | 
NuxeoPrincipalImpl(String name,
                  boolean isAnonymous,
                  boolean isAdministrator)
Constructor that updates all the principal groups. 
 | 
  | 
NuxeoPrincipalImpl(String name,
                  boolean isAnonymous,
                  boolean isAdministrator,
                  boolean updateAllGroups)  | 
| Modifier and Type | Method and Description | 
|---|---|
protected NuxeoPrincipal | 
cloneTransferable()  | 
boolean | 
equals(Object other)  | 
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. 
 | 
UserConfig | 
getConfig()  | 
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 | 
getName()  | 
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()
Deprecated.  
 | 
String | 
getTenantId()
Returns the  
tenantId of this , or null if there is no tenantId. | 
List<String> | 
getVirtualGroups()  | 
int | 
hashCode()  | 
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. 
 | 
void | 
setCompany(String company)  | 
void | 
setConfig(UserConfig config)  | 
void | 
setEmail(String email)  | 
void | 
setFirstName(String firstName)  | 
void | 
setGroups(List<String> groups)  | 
void | 
setLastName(String lastName)  | 
void | 
setModel(DocumentModel model)  | 
void | 
setModel(DocumentModel model,
        boolean updateAllGroups)
Sets model and recomputes all groups. 
 | 
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)  | 
void | 
setVirtualGroups(List<String> virtualGroups)
Sets virtual groups and recomputes all groups. 
 | 
void | 
setVirtualGroups(List<String> virtualGroups,
                boolean updateAllGroups)  | 
String | 
toString()  | 
void | 
updateAllGroups()  | 
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcomputeTransientUsername, isTransientUsernameprotected UserConfig config
public List<String> virtualGroups
public final boolean isAnonymous
public boolean isAdministrator
public String principalId
public DocumentModel model
public String origUserName
public NuxeoPrincipalImpl(String name)
public NuxeoPrincipalImpl(String name, boolean isAnonymous)
public NuxeoPrincipalImpl(String name, boolean isAnonymous, boolean isAdministrator)
public NuxeoPrincipalImpl(String name, boolean isAnonymous, boolean isAdministrator, boolean updateAllGroups)
protected NuxeoPrincipalImpl(NuxeoPrincipalImpl other)
public void setConfig(UserConfig config)
public UserConfig getConfig()
public String getCompany()
NuxeoPrincipalgetCompany in interface NuxeoPrincipalpublic void setCompany(String company)
setCompany in interface NuxeoPrincipalpublic String getFirstName()
NuxeoPrincipalgetFirstName in interface NuxeoPrincipalpublic void setFirstName(String firstName)
setFirstName in interface NuxeoPrincipalpublic String getLastName()
NuxeoPrincipalgetLastName in interface NuxeoPrincipalpublic void setLastName(String lastName)
setLastName in interface NuxeoPrincipalpublic void setName(String name)
setName in interface NuxeoPrincipalpublic void setRoles(List<String> roles)
setRoles in interface NuxeoPrincipalpublic void setGroups(List<String> groups)
setGroups in interface NuxeoPrincipalpublic List<String> getGroups()
NuxeoPrincipalgetGroups in interface NuxeoPrincipal@Deprecated public List<String> getRoles()
NuxeoPrincipalgetRoles in interface NuxeoPrincipalpublic void setPassword(String password)
setPassword in interface NuxeoPrincipalpublic String getPassword()
NuxeoPrincipalNote: Some APIs that return principals from the database intentionally do not fill this field
getPassword in interface NuxeoPrincipalpublic String getPrincipalId()
NuxeoPrincipalgetPrincipalId in interface NuxeoPrincipalpublic void setPrincipalId(String principalId)
NuxeoPrincipalsetPrincipalId in interface NuxeoPrincipalprincipalId - a new principalId for this instancepublic String getEmail()
NuxeoPrincipalgetEmail in interface NuxeoPrincipalpublic void setEmail(String email)
setEmail in interface NuxeoPrincipalpublic DocumentModel getModel()
getModel in interface NuxeoPrincipalpublic void setModel(DocumentModel model, boolean updateAllGroups)
public void setModel(DocumentModel model)
setModel in interface NuxeoPrincipalpublic boolean isMemberOf(String group)
NuxeoPrincipalisMemberOf in interface NuxeoPrincipalgroup - The name of the grouppublic List<String> getAllGroups()
NuxeoPrincipalgetAllGroups in interface NuxeoPrincipalpublic void updateAllGroups()
public List<String> getVirtualGroups()
public void setVirtualGroups(List<String> virtualGroups, boolean updateAllGroups)
public void setVirtualGroups(List<String> virtualGroups)
public boolean isAdministrator()
NuxeoPrincipalSecurity checks still apply on the repository for administrator user. If user is a system user, this method will return true.
isAdministrator in interface NuxeoPrincipalpublic String getTenantId()
NuxeoPrincipaltenantId of this , or null if there is no tenantId.getTenantId in interface NuxeoPrincipalpublic boolean isAnonymous()
NuxeoPrincipalisAnonymous in interface NuxeoPrincipalpublic int hashCode()
public String getOriginatingUser()
NuxeoPrincipalnull if this principal was not created from
 another user.getOriginatingUser in interface NuxeoPrincipalnullpublic void setOriginatingUser(String originatingUser)
NuxeoPrincipalsetOriginatingUser in interface NuxeoPrincipaloriginatingUser - the originating userpublic String getActingUser()
NuxeoPrincipalThis is the originating user (usually when this principal is a system user), or if there is none this principal's user.
getActingUser in interface NuxeoPrincipalpublic boolean isTransient()
NuxeoPrincipalisTransient in interface NuxeoPrincipalprotected NuxeoPrincipal cloneTransferable()
Copyright © 2019 Nuxeo. All rights reserved.