Package org.opencms.file
Class CmsGroup
java.lang.Object
org.opencms.security.CmsPrincipal
org.opencms.file.CmsGroup
- All Implemented Interfaces:
Serializable
,Comparable<I_CmsPrincipal>
,Principal
,I_CmsPrincipal
A group principal in the OpenCms permission system.
- Since:
- 6.0.0
- See Also:
-
Field Summary
Fields inherited from class org.opencms.security.CmsPrincipal
m_description, m_flags, m_id, m_name
Fields inherited from interface org.opencms.security.I_CmsPrincipal
FLAG_CORE_LIMIT, FLAG_DISABLED, FLAG_ENABLED, FLAG_GROUP_ROLE, FLAG_GROUP_VIRTUAL, FLAG_USER_MANAGED, FLAG_USER_WEBUSER, PRINCIPAL_GROUP, PRINCIPAL_USER
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks if the provided group name is valid and can be used as an argument value forCmsPrincipal.setName(String)
.clone()
getDescription
(Locale locale) Returns the description of this organizational unit.Returns the parent group id of this group.static boolean
Checks if the given String starts withI_CmsPrincipal.PRINCIPAL_GROUP
followed by a dot.boolean
isGroup()
Returnstrue
if this principal is of type
.CmsGroup
boolean
isRole()
Checks if this group is a role group.boolean
isUser()
Returnstrue
if this principal is of type
.CmsUser
boolean
Checks if this group is a virtual group, emulating a role.static String
removePrefix
(String principalName) Removes the prefix if the given String starts withI_CmsPrincipal.PRINCIPAL_GROUP
followed by a dot.void
setParentId
(CmsUUID parentId) Sets the parent group id of this group.toString()
Methods inherited from class org.opencms.security.CmsPrincipal
compareTo, equals, filterCoreFlag, filterCoreGroups, filterCoreUsers, filterFlag, getDescription, getDisplayName, getDisplayName, getFlags, getId, getName, getOuFqn, getPrefixedGroup, getPrefixedName, getPrefixedUser, getSimpleName, getType, hashCode, isEnabled, readPrefixedPrincipal, readPrincipal, readPrincipal, readPrincipal, readPrincipalIncludingHistory, setDescription, setEnabled, setFlags, setName
-
Constructor Details
-
CmsGroup
public CmsGroup()Creates a new, empty OpenCms group principal. -
CmsGroup
Creates a new OpenCms group principal.- Parameters:
id
- the unique id of the groupparentId
- the is of the parent groupname
- the fully qualified name of the name of the groupdescription
- the description of the groupflags
- the flags of the group
-
-
Method Details
-
hasPrefix
Checks if the given String starts withI_CmsPrincipal.PRINCIPAL_GROUP
followed by a dot.- Works if the given String is
null
. - Removes white spaces around the String before the check.
- Also works with prefixes not being in upper case.
- Does not check if the group after the prefix actually exists.
- Parameters:
principalName
- the group name to check- Returns:
true
in case the String starts withI_CmsPrincipal.PRINCIPAL_GROUP
- Works if the given String is
-
removePrefix
Removes the prefix if the given String starts withI_CmsPrincipal.PRINCIPAL_GROUP
followed by a dot.- Works if the given String is
null
. - If the given String does not start with
I_CmsPrincipal.PRINCIPAL_GROUP
followed by a dot it is returned unchanged. - Removes white spaces around the group name.
- Also works with prefixes not being in upper case.
- Does not check if the group after the prefix actually exists.
- Parameters:
principalName
- the group name to remove the prefix from- Returns:
- the given String with the prefix
I_CmsPrincipal.PRINCIPAL_GROUP
with the following dot removed
- Works if the given String is
-
checkName
Checks if the provided group name is valid and can be used as an argument value forCmsPrincipal.setName(String)
.A group name must not be empty or whitespace only.
- Parameters:
name
- the group name to check- See Also:
-
clone
-
getDescription
Returns the description of this organizational unit.- Parameters:
locale
- the locale- Returns:
- the description of this organizational unit
-
getParentId
Returns the parent group id of this group.- Returns:
- the parent group id of this group
-
isGroup
Description copied from interface:I_CmsPrincipal
Returnstrue
if this principal is of type
.CmsGroup
- Specified by:
isGroup
in interfaceI_CmsPrincipal
- Overrides:
isGroup
in classCmsPrincipal
- Returns:
true
if this principal is of typeCmsGroup
- See Also:
-
isRole
Checks if this group is a role group.- Returns:
true
if this group is a role group
-
isUser
Description copied from interface:I_CmsPrincipal
Returnstrue
if this principal is of type
.CmsUser
- Specified by:
isUser
in interfaceI_CmsPrincipal
- Overrides:
isUser
in classCmsPrincipal
- Returns:
true
if this principal is of typeCmsUser
- See Also:
-
isVirtual
Checks if this group is a virtual group, emulating a role.- Returns:
- if this group is a virtual group
-
setParentId
Sets the parent group id of this group.- Parameters:
parentId
- the parent group id to set
-
toString
-