Interface I_CmsPrincipal
- All Superinterfaces:
Principal
,Serializable
- All Known Implementing Classes:
CmsGroup
,CmsHistoryPrincipal
,CmsPrincipal
,CmsRoleAsPrincipal
,CmsUser
- Since:
- 6.0.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Upper limit for core flags, any principal object with flags greater than this value will be filtered out.static final int
This flag is set for disabled principals in the database.static final int
This flag is set for enabled principals in the database.static final int
Flag to indicate a role group.static final int
Flag to indicate a virtual group role, after this bit we need to encode a number between 0 and
so we will need up to 4 more bits.CmsRole.getSystemRoles()
.size()-1static final int
Flag to indicate a user is not able to manage himself.static final int
Flag to indicate a user is a webuser.static final String
Identifier for group principals.static final String
Identifier for user principals. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks if the provided principal name is valid and can be used as an argument value forsetName(String)
.boolean
Compares the given object with this principal.Returns the description of this principal.getDescription
(Locale locale) Returns the description of this principal.int
getFlags()
Returns the flags of this principal.getId()
Returns the unique id of this principal.getName()
Returns the unique name of this principal.getOuFqn()
Returns the fully qualified name of the associated organizational unit.Returns this principals unique name prefixed with it's type.Returns the simple name of this organizational unit.int
hashCode()
Returns the hash code of this object.boolean
Returnstrue
if this principal is enabled.boolean
isGroup()
Returnstrue
if this principal is of type
.CmsGroup
boolean
isUser()
Returnstrue
if this principal is of type
.CmsUser
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
Sets the unique name of this principal.
-
Field Details
-
FLAG_CORE_LIMIT
Upper limit for core flags, any principal object with flags greater than this value will be filtered out.- See Also:
-
FLAG_DISABLED
This flag is set for disabled principals in the database.- See Also:
-
FLAG_ENABLED
This flag is set for enabled principals in the database.- See Also:
-
FLAG_GROUP_ROLE
Flag to indicate a role group.- See Also:
-
FLAG_GROUP_VIRTUAL
Flag to indicate a virtual group role, after this bit we need to encode a number between 0 and
so we will need up to 4 more bits.CmsRole.getSystemRoles()
.size()-1- See Also:
-
FLAG_USER_MANAGED
Flag to indicate a user is not able to manage himself.- See Also:
-
FLAG_USER_WEBUSER
Flag to indicate a user is a webuser.- See Also:
-
PRINCIPAL_GROUP
Identifier for group principals.- See Also:
-
PRINCIPAL_USER
Identifier for user principals.- See Also:
-
-
Method Details
-
checkName
Checks if the provided principal name is valid and can be used as an argument value forsetName(String)
.- Parameters:
name
- the principal name to check
-
equals
Compares the given object with this principal. -
getDescription
Returns the description of this principal.- Returns:
- the description of this principal
-
getDescription
Returns the description of this principal.- Parameters:
locale
- locale of the description- Returns:
- the description of this principal
-
getFlags
int getFlags()Returns the flags of this principal.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.isEnabled()
- Returns:
- the flags of this principal
-
getId
Returns the unique id of this principal.- Returns:
- the unique id of this principal
-
getName
Returns the unique name of this principal. -
getOuFqn
Returns the fully qualified name of the associated organizational unit.- Returns:
- the fully qualified name of the associated organizational unit
-
getPrefixedName
Returns this principals unique name prefixed with it's type.The type prefix can either be
(for groups) orPRINCIPAL_GROUP
.
(for users).PRINCIPAL_USER
.- Returns:
- this principals unique name prefixed with this principals type
-
getSimpleName
Returns the simple name of this organizational unit.- Returns:
- the simple name of this organizational unit.
-
hashCode
int hashCode()Returns the hash code of this object. -
isEnabled
boolean isEnabled()Returnstrue
if this principal is enabled.A principal may be disabled in order to disable 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.
- Returns:
true
if this principal is enabled
-
isGroup
boolean isGroup()Returnstrue
if this principal is of type
.CmsGroup
- Returns:
true
if this principal is of typeCmsGroup
-
isUser
boolean isUser()Returnstrue
if this principal is of type
.CmsUser
- Returns:
true
if this principal is of typeCmsUser
-
setDescription
Sets the description of this principal.- Parameters:
description
- the principal description to set
-
setEnabled
Enables (or disables) this principal, depending on the given status.- Parameters:
enabled
- the principal status to set
-
setFlags
Sets this principals flags to the specified value.The principal flags are used to store special information about the principals state encoded bitwise. Usually the flags integer value should not be directly accessed. Utility methods like
provide a much easier way to manipulate the information contained in the flags.setEnabled(boolean)
- Parameters:
value
- the value to set this principals flags to
-
setName
Sets the unique name of this principal.- Parameters:
name
- the unique name of this principal to set
-