Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.core.api
Interface NuxeoPrincipal

All Superinterfaces:
java.security.Principal, java.io.Serializable
All Known Implementing Classes:
DetachedNuxeoPrincipal, NuxeoPrincipalImpl, SystemPrincipal, UserPrincipal

public interface NuxeoPrincipal
extends java.security.Principal, java.io.Serializable

Class to represent a principal in Nuxeo. This class holds the list of roles and groups for this principal.

Author:
Bogdan Stefanescu

Field Summary
static java.lang.String PREFIX
           
 
Method Summary
 java.util.List<java.lang.String> getAllGroups()
          Gets the groups this principal directly or undirectly is member of.
 java.lang.String getCompany()
          Gets the company name of this principal.
 java.lang.String getFirstName()
          Gets the first name of this principal.
 java.util.List<java.lang.String> getGroups()
          Gets the groups this principal is directly member of.
 java.lang.String getLastName()
          Gets the last name of this principal.
 DocumentModel getModel()
           
 java.lang.String getOriginatingUser()
           
 java.lang.String getPassword()
          Gets the password of this principal.
 java.lang.String getPrincipalId()
          Returns a generated id that is unique for each principal instance.
 java.util.List<java.lang.String> getRoles()
          Gets the roles for this principal.
 boolean isAdministrator()
          Returns true if the principal is an administrator.
 boolean isAnonymous()
          Checks if the principal is anonymous (guest user).
 boolean isMemberOf(java.lang.String group)
          Recursively test if the user is member of this group.
 void setCompany(java.lang.String company)
           
 void setFirstName(java.lang.String firstName)
           
 void setGroups(java.util.List<java.lang.String> groups)
           
 void setLastName(java.lang.String lastName)
           
 void setModel(DocumentModel model)
           
 void setName(java.lang.String name)
           
 void setOriginatingUser(java.lang.String originatingUser)
           
 void setPassword(java.lang.String password)
           
 void setPrincipalId(java.lang.String principalId)
          Sets the principalId.
 void setRoles(java.util.List<java.lang.String> roles)
           
 
Methods inherited from interface java.security.Principal
equals, getName, hashCode, toString
 

Field Detail

PREFIX

static final java.lang.String PREFIX
See Also:
Constant Field Values
Method Detail

getFirstName

java.lang.String getFirstName()
Gets the first name of this principal.

Returns:
the first name of this principal

getLastName

java.lang.String getLastName()
Gets the last name of this principal.

Returns:
the last name of this principal

getPassword

java.lang.String getPassword()
Gets the password of this principal.

Note: Some APIs that return principals from the database intentionally do not fill this field

Returns:
the password of this principal

getCompany

java.lang.String getCompany()
Gets the company name of this principal.

Returns:
the company name

getGroups

java.util.List<java.lang.String> getGroups()
Gets the groups this principal is directly member of.

Returns:
the list of the groups

getAllGroups

java.util.List<java.lang.String> getAllGroups()
Gets the groups this principal directly or undirectly is member of.

Returns:
the list of the groups

isMemberOf

boolean isMemberOf(java.lang.String group)
Recursively test if the user is member of this group.

Parameters:
group - The name of the group

getRoles

java.util.List<java.lang.String> getRoles()
Gets the roles for this principal.

Returns:
the list of the roles

setName

void setName(java.lang.String name)

setFirstName

void setFirstName(java.lang.String firstName)

setLastName

void setLastName(java.lang.String lastName)

setGroups

void setGroups(java.util.List<java.lang.String> groups)

setRoles

void setRoles(java.util.List<java.lang.String> roles)

setCompany

void setCompany(java.lang.String company)

setPassword

void setPassword(java.lang.String password)

getPrincipalId

java.lang.String getPrincipalId()
Returns a generated id that is unique for each principal instance.

Returns:
a unique string

setPrincipalId

void setPrincipalId(java.lang.String principalId)
Sets the principalId.

Parameters:
principalId - a new principalId for this instance

getModel

DocumentModel getModel()

setModel

void setModel(DocumentModel model)
              throws ClientException
Throws:
ClientException

isAdministrator

boolean isAdministrator()
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.

Returns:
true if the principal is an administrator.

isAnonymous

boolean isAnonymous()
Checks if the principal is anonymous (guest user).

Returns:
true if the principal is anonymous.

getOriginatingUser

java.lang.String getOriginatingUser()

setOriginatingUser

void setOriginatingUser(java.lang.String originatingUser)

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.