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_nameFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidChecks 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 booleanChecks if the given String starts withI_CmsPrincipal.PRINCIPAL_GROUPfollowed by a dot.booleanisGroup()Returnstrueif this principal is of type.CmsGroupbooleanisRole()Checks if this group is a role group.booleanisUser()Returnstrueif this principal is of type.CmsUserbooleanChecks if this group is a virtual group, emulating a role.static StringremovePrefix(String principalName) Removes the prefix if the given String starts withI_CmsPrincipal.PRINCIPAL_GROUPfollowed by a dot.voidsetParentId(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_GROUPfollowed 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:
truein 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_GROUPfollowed by a dot.- Works if the given String is
null. - If the given String does not start with
I_CmsPrincipal.PRINCIPAL_GROUPfollowed 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_GROUPwith 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_CmsPrincipalReturnstrueif this principal is of type.CmsGroup- Specified by:
isGroupin interfaceI_CmsPrincipal- Overrides:
isGroupin classCmsPrincipal- Returns:
trueif this principal is of typeCmsGroup- See Also:
-
isRole
Checks if this group is a role group.- Returns:
trueif this group is a role group
-
isUser
Description copied from interface:I_CmsPrincipalReturnstrueif this principal is of type.CmsUser- Specified by:
isUserin interfaceI_CmsPrincipal- Overrides:
isUserin classCmsPrincipal- Returns:
trueif 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
-