Package org.nuxeo.ecm.core.api
Class SystemPrincipal
java.lang.Object
org.nuxeo.ecm.core.api.SystemPrincipal
- All Implemented Interfaces:
Serializable,Principal,NuxeoPrincipal
- Author:
- Bogdan Stefanescu
- See Also:
-
Field Summary
Fields inherited from interface org.nuxeo.ecm.core.api.NuxeoPrincipal
PREFIX, TRANSIENT_USER_PREFIX, TRANSIENT_USERNAME_UNIQUE_PROP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets 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, ornullif 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()Gets the roles for this principal.inthashCode()booleanReturns true if the principal is an administrator.booleanChecks if the principal is anonymous (guest user).booleanisMemberOf(String group) Recursively test if the user is member of this group.booleanReturns true if the principal is a transient principal.voidsetCompany(String company) voidvoidsetFirstName(String firstName) voidvoidsetLastName(String lastName) voidsetModel(DocumentModel model) voidvoidsetOriginatingUser(String originatingUser) Sets the originating user.voidsetPassword(String password) voidsetPrincipalId(String principalId) Sets the principalId.voidtoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.nuxeo.ecm.core.api.NuxeoPrincipal
getId
-
Constructor Details
-
SystemPrincipal
-
-
Method Details
-
getName
-
getCompany
Description copied from interface:NuxeoPrincipalGets the company name of this principal.- Specified by:
getCompanyin interfaceNuxeoPrincipal- Returns:
- the company name
-
getEmail
Description copied from interface:NuxeoPrincipalGet the user email if any. Return null if not email was specified- Specified by:
getEmailin interfaceNuxeoPrincipal- Returns:
- the user email or null if none
-
setEmail
- Specified by:
setEmailin interfaceNuxeoPrincipal
-
getFirstName
Description copied from interface:NuxeoPrincipalGets the first name of this principal.- Specified by:
getFirstNamein interfaceNuxeoPrincipal- Returns:
- the first name of this principal
-
getLastName
Description copied from interface:NuxeoPrincipalGets the last name of this principal.- Specified by:
getLastNamein interfaceNuxeoPrincipal- Returns:
- the last name of this principal
-
getGroups
Description copied from interface:NuxeoPrincipalGets the groups this principal is directly member of.- Specified by:
getGroupsin interfaceNuxeoPrincipal- Returns:
- the list of the groups
-
getAllGroups
Description copied from interface:NuxeoPrincipalGets the groups this principal directly or undirectly is member of.- Specified by:
getAllGroupsin interfaceNuxeoPrincipal- Returns:
- the list of the groups
-
getRoles
Description copied from interface:NuxeoPrincipalGets the roles for this principal.- Specified by:
getRolesin interfaceNuxeoPrincipal- Returns:
- the list of the roles
-
getPassword
Description copied from interface:NuxeoPrincipalGets the password of this principal.Note: Some APIs that return principals from the database intentionally do not fill this field
- Specified by:
getPasswordin interfaceNuxeoPrincipal- Returns:
- the password of this principal
-
getPrincipalId
Description copied from interface:NuxeoPrincipalReturns a generated id that is unique for each principal instance.- Specified by:
getPrincipalIdin interfaceNuxeoPrincipal- Returns:
- a unique string
-
getOriginatingUser
Description copied from interface:NuxeoPrincipalGets the base user from which this principal was created, ornullif this principal was not created from another user.- Specified by:
getOriginatingUserin interfaceNuxeoPrincipal- Returns:
- the originating user, or
null
-
setOriginatingUser
Description copied from interface:NuxeoPrincipalSets the originating user.- Specified by:
setOriginatingUserin interfaceNuxeoPrincipal- Parameters:
originatingUser- the originating user
-
getActingUser
Description copied from interface:NuxeoPrincipalGets 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:
getActingUserin interfaceNuxeoPrincipal- Returns:
- the acting user
-
getModel
- Specified by:
getModelin interfaceNuxeoPrincipal
-
setCompany
- Specified by:
setCompanyin interfaceNuxeoPrincipal
-
setFirstName
- Specified by:
setFirstNamein interfaceNuxeoPrincipal
-
setLastName
- Specified by:
setLastNamein interfaceNuxeoPrincipal
-
setName
- Specified by:
setNamein interfaceNuxeoPrincipal
-
setGroups
- Specified by:
setGroupsin interfaceNuxeoPrincipal
-
setRoles
- Specified by:
setRolesin interfaceNuxeoPrincipal
-
setPassword
- Specified by:
setPasswordin interfaceNuxeoPrincipal
-
setPrincipalId
Description copied from interface:NuxeoPrincipalSets the principalId.- Specified by:
setPrincipalIdin interfaceNuxeoPrincipal- Parameters:
principalId- a new principalId for this instance
-
setModel
- Specified by:
setModelin interfaceNuxeoPrincipal
-
isMemberOf
Description copied from interface:NuxeoPrincipalRecursively test if the user is member of this group.- Specified by:
isMemberOfin interfaceNuxeoPrincipal- Parameters:
group- The name of the group
-
isAdministrator
public boolean isAdministrator()Description copied from interface:NuxeoPrincipalReturns 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:
isAdministratorin interfaceNuxeoPrincipal- Returns:
- true if the principal is an administrator.
-
getTenantId
Description copied from interface:NuxeoPrincipal- Specified by:
getTenantIdin interfaceNuxeoPrincipal
-
isAnonymous
public boolean isAnonymous()Description copied from interface:NuxeoPrincipalChecks if the principal is anonymous (guest user).- Specified by:
isAnonymousin interfaceNuxeoPrincipal- Returns:
- true if the principal is anonymous.
-
isTransient
public boolean isTransient()Description copied from interface:NuxeoPrincipalReturns true if the principal is a transient principal.- Specified by:
isTransientin interfaceNuxeoPrincipal
-
hashCode
public int hashCode() -
equals
-
toString
-