Class NuxeoPrincipalImpl
java.lang.Object
org.nuxeo.ecm.platform.usermanager.NuxeoPrincipalImpl
- All Implemented Interfaces:
Serializable
,Principal
,NuxeoPrincipal
- Direct Known Subclasses:
MultiTenantPrincipal
,NuxeoPrincipalImpl.TransferableClone
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Provides another implementation which marshall the user id instead of transferring the whole content and resolve it when unmarshalled. -
Field Summary
Fields inherited from interface org.nuxeo.ecm.core.api.NuxeoPrincipal
PREFIX, TRANSIENT_USER_FORMAT, TRANSIENT_USER_PREFIX, TRANSIENT_USERNAME_UNIQUE_PROP
-
Constructor Summary
ModifierConstructorDescriptionNuxeoPrincipalImpl
(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) protected
-
Method Summary
Modifier and TypeMethodDescriptionprotected NuxeoPrincipal
boolean
Gets the acting user for this principal.Gets the groups this principal directly or undirectly is member of.Gets the company name of this principal.getEmail()
Get the user email if any.Gets the first name of this principal.Gets the groups this principal is directly member of.Gets the last name of this principal.getModel()
getName()
Gets the base user from which this principal was created, ornull
if this principal was not created from another user.Gets the password of this principal.Returns a generated id that is unique for each principal instance.getRoles()
Deprecated.int
hashCode()
boolean
Returns true if the principal is an administrator.boolean
Checks if the principal is anonymous (guest user).boolean
isMemberOf
(String group) Recursively test if the user is member of this group.boolean
Returns true if the principal is a transient principal.void
setCompany
(String company) void
setConfig
(UserConfig config) void
void
setFirstName
(String firstName) void
void
setLastName
(String lastName) void
setModel
(DocumentModel model) void
setModel
(DocumentModel model, boolean updateAllGroups) Sets model and recomputes all groups.void
void
setOriginatingUser
(String originatingUser) Sets the originating user.void
setPassword
(String password) void
setPrincipalId
(String principalId) Sets the principalId.void
void
setVirtualGroups
(List<String> virtualGroups) Sets virtual groups and recomputes all groups.void
setVirtualGroups
(List<String> virtualGroups, boolean updateAllGroups) toString()
void
-
Field Details
-
config
-
roles
-
virtualGroups
-
allGroups
-
isAnonymous
public final boolean isAnonymous -
isAdministrator
public boolean isAdministrator -
principalId
-
model
-
dataModel
-
origUserName
-
-
Constructor Details
-
NuxeoPrincipalImpl
Constructor that sets principal to not anonymous, not administrator, and updates all the principal groups. -
NuxeoPrincipalImpl
Constructor that sets principal to not administrator, and updates all the principal groups. -
NuxeoPrincipalImpl
Constructor that updates all the principal groups. -
NuxeoPrincipalImpl
public NuxeoPrincipalImpl(String name, boolean isAnonymous, boolean isAdministrator, boolean updateAllGroups) -
NuxeoPrincipalImpl
-
-
Method Details
-
setConfig
-
getConfig
-
getCompany
Description copied from interface:NuxeoPrincipal
Gets the company name of this principal.- Specified by:
getCompany
in interfaceNuxeoPrincipal
- Returns:
- the company name
-
setCompany
- Specified by:
setCompany
in interfaceNuxeoPrincipal
-
getFirstName
Description copied from interface:NuxeoPrincipal
Gets the first name of this principal.- Specified by:
getFirstName
in interfaceNuxeoPrincipal
- Returns:
- the first name of this principal
-
setFirstName
- Specified by:
setFirstName
in interfaceNuxeoPrincipal
-
getLastName
Description copied from interface:NuxeoPrincipal
Gets the last name of this principal.- Specified by:
getLastName
in interfaceNuxeoPrincipal
- Returns:
- the last name of this principal
-
setLastName
- Specified by:
setLastName
in interfaceNuxeoPrincipal
-
setName
- Specified by:
setName
in interfaceNuxeoPrincipal
-
setRoles
- Specified by:
setRoles
in interfaceNuxeoPrincipal
-
setGroups
- Specified by:
setGroups
in interfaceNuxeoPrincipal
-
getName
-
getGroups
Description copied from interface:NuxeoPrincipal
Gets the groups this principal is directly member of.- Specified by:
getGroups
in interfaceNuxeoPrincipal
- Returns:
- the list of the groups
-
getRoles
Deprecated.Description copied from interface:NuxeoPrincipal
Gets the roles for this principal.- Specified by:
getRoles
in interfaceNuxeoPrincipal
- Returns:
- the list of the roles
-
setPassword
- Specified by:
setPassword
in interfaceNuxeoPrincipal
-
getPassword
Description copied from interface:NuxeoPrincipal
Gets the password of this principal.Note: Some APIs that return principals from the database intentionally do not fill this field
- Specified by:
getPassword
in interfaceNuxeoPrincipal
- Returns:
- the password of this principal
-
toString
-
getPrincipalId
Description copied from interface:NuxeoPrincipal
Returns a generated id that is unique for each principal instance.- Specified by:
getPrincipalId
in interfaceNuxeoPrincipal
- Returns:
- a unique string
-
setPrincipalId
Description copied from interface:NuxeoPrincipal
Sets the principalId.- Specified by:
setPrincipalId
in interfaceNuxeoPrincipal
- Parameters:
principalId
- a new principalId for this instance
-
getEmail
Description copied from interface:NuxeoPrincipal
Get the user email if any. Return null if not email was specified- Specified by:
getEmail
in interfaceNuxeoPrincipal
- Returns:
- the user email or null if none
-
setEmail
- Specified by:
setEmail
in interfaceNuxeoPrincipal
-
getModel
- Specified by:
getModel
in interfaceNuxeoPrincipal
-
setModel
Sets model and recomputes all groups. -
setModel
- Specified by:
setModel
in interfaceNuxeoPrincipal
-
isMemberOf
Description copied from interface:NuxeoPrincipal
Recursively test if the user is member of this group.- Specified by:
isMemberOf
in interfaceNuxeoPrincipal
- Parameters:
group
- The name of the group
-
getAllGroups
Description copied from interface:NuxeoPrincipal
Gets the groups this principal directly or undirectly is member of.- Specified by:
getAllGroups
in interfaceNuxeoPrincipal
- Returns:
- the list of the groups
-
updateAllGroups
public void updateAllGroups() -
getVirtualGroups
-
setVirtualGroups
-
setVirtualGroups
Sets virtual groups and recomputes all groups. -
isAdministrator
public boolean isAdministrator()Description copied from interface:NuxeoPrincipal
Returns true if the principal is an administrator.Security checks still apply on the repository for administrator user. If user is a system user, this method will return true.
- Specified by:
isAdministrator
in interfaceNuxeoPrincipal
- Returns:
- true if the principal is an administrator.
-
getTenantId
Description copied from interface:NuxeoPrincipal
- Specified by:
getTenantId
in interfaceNuxeoPrincipal
-
isAnonymous
public boolean isAnonymous()Description copied from interface:NuxeoPrincipal
Checks if the principal is anonymous (guest user).- Specified by:
isAnonymous
in interfaceNuxeoPrincipal
- Returns:
- true if the principal is anonymous.
-
equals
-
hashCode
public int hashCode() -
getOriginatingUser
Description copied from interface:NuxeoPrincipal
Gets the base user from which this principal was created, ornull
if this principal was not created from another user.- Specified by:
getOriginatingUser
in interfaceNuxeoPrincipal
- Returns:
- the originating user, or
null
-
setOriginatingUser
Description copied from interface:NuxeoPrincipal
Sets the originating user.- Specified by:
setOriginatingUser
in interfaceNuxeoPrincipal
- Parameters:
originatingUser
- the originating user
-
getActingUser
Description copied from interface:NuxeoPrincipal
Gets the acting user for this principal.This is the originating user (usually when this principal is a system user), or if there is none this principal's user.
- Specified by:
getActingUser
in interfaceNuxeoPrincipal
- Returns:
- the acting user
-
isTransient
public boolean isTransient()Description copied from interface:NuxeoPrincipal
Returns true if the principal is a transient principal.- Specified by:
isTransient
in interfaceNuxeoPrincipal
-
cloneTransferable
-