|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opencms.security.CmsPrincipal
public abstract class CmsPrincipal
Common methods shared among user and group principals, also contains several utility functions to deal with principal instances.
| Field Summary | |
|---|---|
protected String |
m_description
The description of this principal. |
protected int |
m_flags
The flags of this principal. |
protected CmsUUID |
m_id
The unique id of this principal. |
protected String |
m_name
The name of this principal. |
| Fields inherited from interface org.opencms.security.I_CmsPrincipal |
|---|
FLAG_CORE_LIMIT, FLAG_DISABLED, FLAG_ENABLED, FLAG_GROUP_PROJECT_MANAGER, FLAG_GROUP_PROJECT_USER, FLAG_GROUP_WORKFLOW_ROLE, PRINCIPAL_GROUP, PRINCIPAL_USER |
| Constructor Summary | |
|---|---|
protected |
CmsPrincipal()
Empty constructor for subclassing. |
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
Compares the given object with this principal. |
static List |
filterCore(List principals)
Filters out all principals with flags greater than . |
static List |
filterCoreFlag(List principals,
int flag)
Filters out all principals that do not have the given flag set, but leaving principals with flags less than untouched. |
static List |
filterFlag(List principals,
int flag)
Filters out all principals that do not have the given flag set. |
String |
getDescription()
Returns the description of this principal. |
int |
getFlags()
Returns the flags of this principal. |
CmsUUID |
getId()
Returns the unique id of this principal. |
String |
getName()
Returns the unique name of this principal. |
static String |
getPrefixedGroup(String name)
Returns the provided group name prefixed with . |
String |
getPrefixedName()
Returns this principals unique name prefixed with it's type. |
static String |
getPrefixedUser(String name)
Returns the provided user name prefixed with . |
int |
hashCode()
Returns the hash code of this object. |
boolean |
isEnabled()
Returns true if this principal is enabled. |
boolean |
isGroup()
Returns true if this principal is of type . |
boolean |
isUser()
Returns true if this principal is of type . |
static I_CmsPrincipal |
readPrefixedPrincipal(CmsObject cms,
String name)
Utility function to read a prefixed principal from the OpenCms database using the provided OpenCms user context. |
static I_CmsPrincipal |
readPrincipal(CmsObject cms,
String type,
String name)
Utility function to read a principal of the given type from the OpenCms database using the provided OpenCms user context. |
void |
setDescription(String description)
Sets the description of this principal. |
void |
setEnabled(boolean enabled)
Enables (or disables) this principal, depending on the given status. |
void |
setFlags(int value)
Sets this principals flags to the specified value. |
void |
setName(String name)
Sets the unique name of this principal. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.opencms.security.I_CmsPrincipal |
|---|
checkName |
| Methods inherited from interface java.security.Principal |
|---|
toString |
| Field Detail |
|---|
protected String m_description
protected int m_flags
protected CmsUUID m_id
protected String m_name
| Constructor Detail |
|---|
protected CmsPrincipal()
| Method Detail |
|---|
public static List filterCore(List principals)
I_CmsPrincipal.FLAG_CORE_LIMIT.The given parameter list is directly modified, so the returned list is the same object as the input list.
principals - a list of CmsPrincipal objects
public static List filterCoreFlag(List principals,
int flag)
I_CmsPrincipal.FLAG_CORE_LIMIT untouched.The given parameter list is directly modified, so the returned list is the same object as the input list.
principals - a list of CmsPrincipal objectsflag - the flag for filtering
public static List filterFlag(List principals,
int flag)
The given parameter list is directly modified, so the returned list is the same object as the input list.
principals - the list of CmsPrincipal objectsflag - the flag for filtering
public static String getPrefixedGroup(String name)
I_CmsPrincipal.PRINCIPAL_GROUP..
name - the name to add the prefix to
I_CmsPrincipal.PRINCIPAL_GROUP.public static String getPrefixedUser(String name)
I_CmsPrincipal.PRINCIPAL_USER..
name - the name to add the prefix to
I_CmsPrincipal.PRINCIPAL_USER.
public static I_CmsPrincipal readPrefixedPrincipal(CmsObject cms,
String name)
throws CmsException
The principal must be either prefixed with or
I_CmsPrincipal.PRINCIPAL_GROUP..I_CmsPrincipal.PRINCIPAL_USER.
cms - the OpenCms user context to use when reading the principalname - the prefixed principal name
CmsException - in case the principal could not be read
public static I_CmsPrincipal readPrincipal(CmsObject cms,
String type,
String name)
throws CmsException
The type must either be or
I_CmsPrincipal.PRINCIPAL_GROUP.I_CmsPrincipal.PRINCIPAL_USER
cms - the OpenCms user context to use when reading the principaltype - the principal typename - the principal name
CmsException - in case the principal could not be readpublic boolean equals(Object obj)
I_CmsPrincipal
equals in interface Principalequals in interface I_CmsPrincipalequals in class Objectobj - object to comapre
Object.equals(java.lang.Object)public String getDescription()
I_CmsPrincipal
getDescription in interface I_CmsPrincipalI_CmsPrincipal.getDescription()public int getFlags()
I_CmsPrincipal
The principal flags are used to store special information about the
principals state encoded bitwise. Usually the flags int value should not
be directly accessed. Utility methods like
provide a much easier way to access the information contained in the flags.I_CmsPrincipal.isEnabled()
getFlags in interface I_CmsPrincipalI_CmsPrincipal.getFlags()public CmsUUID getId()
I_CmsPrincipal
getId in interface I_CmsPrincipalI_CmsPrincipal.getId()public String getName()
I_CmsPrincipal
getName in interface PrincipalgetName in interface I_CmsPrincipalPrincipal.getName()public String getPrefixedName()
I_CmsPrincipal
The type prefix can either be
(for groups) or I_CmsPrincipal.PRINCIPAL_GROUP. (for users).I_CmsPrincipal.PRINCIPAL_USER.
getPrefixedName in interface I_CmsPrincipalI_CmsPrincipal.getPrefixedName()public int hashCode()
I_CmsPrincipal
hashCode in interface PrincipalhashCode in interface I_CmsPrincipalhashCode in class ObjectObject.hashCode()public boolean isEnabled()
I_CmsPrincipaltrue if this principal is enabled.A principal may be disabled in order to deactivate it, for example to prevent logins of a user. If a principal is just disabled but not deleted, the credentials of the principal in the VFS are still valid.
isEnabled in interface I_CmsPrincipaltrue if this principal is enabledI_CmsPrincipal.isEnabled()public boolean isGroup()
I_CmsPrincipaltrue if this principal is of type CmsGroup.
isGroup in interface I_CmsPrincipaltrue if this principal is of type CmsGroupI_CmsPrincipal.isGroup()public boolean isUser()
I_CmsPrincipaltrue if this principal is of type CmsUser.
isUser in interface I_CmsPrincipaltrue if this principal is of type CmsUserI_CmsPrincipal.isUser()public void setDescription(String description)
I_CmsPrincipal
setDescription in interface I_CmsPrincipaldescription - the principal description to setI_CmsPrincipal.setDescription(java.lang.String)public void setEnabled(boolean enabled)
I_CmsPrincipal
setEnabled in interface I_CmsPrincipalenabled - the principal status to setI_CmsPrincipal.setEnabled(boolean)public void setFlags(int value)
I_CmsPrincipal
The principal flags are used to store special information about the
principals state encoded bitwise. Usually the flags int value should not
be directly accessed. Utility methods like
provide a much easier way to manipulate the information contained in the flags.I_CmsPrincipal.setEnabled(boolean)
setFlags in interface I_CmsPrincipalvalue - the value to set this principals flags toI_CmsPrincipal.setFlags(int)public void setName(String name)
I_CmsPrincipal
setName in interface I_CmsPrincipalname - the unique name of this principal to setI_CmsPrincipal.setName(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||