Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.core.api.impl
Class UserPrincipal

java.lang.Object
  extended by org.nuxeo.ecm.core.api.impl.UserPrincipal
All Implemented Interfaces:
java.io.Serializable, java.security.Principal, NuxeoPrincipal

public class UserPrincipal
extends java.lang.Object
implements NuxeoPrincipal, java.io.Serializable

NuxeoPrincipal stub implementation.

Author:
Bogdan Stefanescu
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.nuxeo.ecm.core.api.NuxeoPrincipal
PREFIX
 
Constructor Summary
UserPrincipal(java.lang.String username)
          Deprecated. use {UserPrincipal(String, List, boolean, boolean)}
UserPrincipal(java.lang.String username, java.util.List<java.lang.String> groups)
          Deprecated. use {UserPrincipal(String, List, boolean, boolean)}
UserPrincipal(java.lang.String username, java.util.List<java.lang.String> groups, boolean anonymous, boolean administrator)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 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 getName()
           
 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.
 int hashCode()
           
 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 class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.security.Principal
toString
 

Constructor Detail

UserPrincipal

@Deprecated
public UserPrincipal(java.lang.String username)
Deprecated. use {UserPrincipal(String, List, boolean, boolean)}


UserPrincipal

@Deprecated
public UserPrincipal(java.lang.String username,
                                java.util.List<java.lang.String> groups)
Deprecated. use {UserPrincipal(String, List, boolean, boolean)}


UserPrincipal

public UserPrincipal(java.lang.String username,
                     java.util.List<java.lang.String> groups,
                     boolean anonymous,
                     boolean administrator)
Method Detail

getCompany

public java.lang.String getCompany()
Description copied from interface: NuxeoPrincipal
Gets the company name of this principal.

Specified by:
getCompany in interface NuxeoPrincipal
Returns:
the company name

getFirstName

public java.lang.String getFirstName()
Description copied from interface: NuxeoPrincipal
Gets the first name of this principal.

Specified by:
getFirstName in interface NuxeoPrincipal
Returns:
the first name of this principal

getLastName

public java.lang.String getLastName()
Description copied from interface: NuxeoPrincipal
Gets the last name of this principal.

Specified by:
getLastName in interface NuxeoPrincipal
Returns:
the last name of this principal

setCompany

public void setCompany(java.lang.String company)
Specified by:
setCompany in interface NuxeoPrincipal

setFirstName

public void setFirstName(java.lang.String firstName)
Specified by:
setFirstName in interface NuxeoPrincipal

setLastName

public void setLastName(java.lang.String lastName)
Specified by:
setLastName in interface NuxeoPrincipal

setName

public void setName(java.lang.String name)
Specified by:
setName in interface NuxeoPrincipal

getName

public java.lang.String getName()
Specified by:
getName in interface java.security.Principal

getGroups

public java.util.List<java.lang.String> getGroups()
Description copied from interface: NuxeoPrincipal
Gets the groups this principal is directly member of.

Specified by:
getGroups in interface NuxeoPrincipal
Returns:
the list of the groups

getAllGroups

public java.util.List<java.lang.String> getAllGroups()
Description copied from interface: NuxeoPrincipal
Gets the groups this principal directly or undirectly is member of.

Specified by:
getAllGroups in interface NuxeoPrincipal
Returns:
the list of the groups

getRoles

public java.util.List<java.lang.String> getRoles()
Description copied from interface: NuxeoPrincipal
Gets the roles for this principal.

Specified by:
getRoles in interface NuxeoPrincipal
Returns:
the list of the roles

setGroups

public void setGroups(java.util.List<java.lang.String> groups)
Specified by:
setGroups in interface NuxeoPrincipal

setRoles

public void setRoles(java.util.List<java.lang.String> roles)
Specified by:
setRoles in interface NuxeoPrincipal

getPassword

public java.lang.String 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 interface NuxeoPrincipal
Returns:
the password of this principal

setPassword

public void setPassword(java.lang.String password)
Specified by:
setPassword in interface NuxeoPrincipal

getPrincipalId

public java.lang.String getPrincipalId()
Description copied from interface: NuxeoPrincipal
Returns a generated id that is unique for each principal instance.

Specified by:
getPrincipalId in interface NuxeoPrincipal
Returns:
a unique string

setPrincipalId

public void setPrincipalId(java.lang.String principalId)
Description copied from interface: NuxeoPrincipal
Sets the principalId.

Specified by:
setPrincipalId in interface NuxeoPrincipal
Parameters:
principalId - a new principalId for this instance

getModel

public DocumentModel getModel()
Specified by:
getModel in interface NuxeoPrincipal

setModel

public void setModel(DocumentModel model)
Specified by:
setModel in interface NuxeoPrincipal

isMemberOf

public boolean isMemberOf(java.lang.String group)
Description copied from interface: NuxeoPrincipal
Recursively test if the user is member of this group.

Specified by:
isMemberOf in interface NuxeoPrincipal
Parameters:
group - The name of the group

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.security.Principal
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Specified by:
hashCode in interface java.security.Principal
Overrides:
hashCode in class java.lang.Object

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 interface NuxeoPrincipal
Returns:
true if the principal is an administrator.

isAnonymous

public boolean isAnonymous()
Description copied from interface: NuxeoPrincipal
Checks if the principal is anonymous (guest user).

Specified by:
isAnonymous in interface NuxeoPrincipal
Returns:
true if the principal is anonymous.

getOriginatingUser

public java.lang.String getOriginatingUser()
Specified by:
getOriginatingUser in interface NuxeoPrincipal

setOriginatingUser

public void setOriginatingUser(java.lang.String originatingUser)
Specified by:
setOriginatingUser in interface NuxeoPrincipal

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.