Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.api
Interface NuxeoPrincipal

All Superinterfaces:
Principal, Serializable
All Known Implementing Classes:
DetachedNuxeoPrincipal, NuxeoPrincipalImpl, SystemPrincipal, UserPrincipal

public interface NuxeoPrincipal
extends Principal, 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 String PREFIX
           
 
Method Summary
 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()
           
 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.
 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.
 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)
           
 void setPassword(String password)
           
 void setPrincipalId(String principalId)
          Sets the principalId.
 void setRoles(List<String> roles)
           
 
Methods inherited from interface java.security.Principal
equals, getName, hashCode, toString
 

Field Detail

PREFIX

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

getFirstName

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

Returns:
the first name of this principal

getLastName

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

Returns:
the last name of this principal

getPassword

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

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

Returns:
the company name

getEmail

String getEmail()
Get the user email if any. Return null if not email was specified

Returns:
the user email or null if none

getGroups

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

Returns:
the list of the groups

getAllGroups

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

Returns:
the list of the groups

isMemberOf

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

Parameters:
group - The name of the group

getRoles

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

Returns:
the list of the roles

setName

void setName(String name)

setFirstName

void setFirstName(String firstName)

setLastName

void setLastName(String lastName)

setGroups

void setGroups(List<String> groups)

setRoles

void setRoles(List<String> roles)

setCompany

void setCompany(String company)

setPassword

void setPassword(String password)

setEmail

void setEmail(String email)

getPrincipalId

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

Returns:
a unique string

setPrincipalId

void setPrincipalId(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

String getOriginatingUser()

setOriginatingUser

void setOriginatingUser(String originatingUser)

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.