Package org.opencms.security
Class CmsRoleAsPrincipal
java.lang.Object
org.opencms.security.CmsPrincipal
org.opencms.security.CmsRoleAsPrincipal
- All Implemented Interfaces:
Serializable
,Comparable<I_CmsPrincipal>
,Principal
,I_CmsPrincipal
Wrapper around CmsRole objects so they can be used as principals.
- 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 principal name is valid and can be used as an argument value forI_CmsPrincipal.setName(String)
.getDescription
(Locale locale) Returns the description of this principal.getDisplayName
(CmsObject cms, Locale locale) Returns the display name of this principal including the organizational unit.getDisplayName
(CmsObject cms, Locale locale, I_CmsGroupNameTranslation translation) Returns the translated display name of this principal if it is a group and the display name otherwise.getRole()
Gets the wrapped role.Methods inherited from class org.opencms.security.CmsPrincipal
compareTo, equals, filterCoreFlag, filterCoreGroups, filterCoreUsers, filterFlag, getDescription, getFlags, getId, getName, getOuFqn, getPrefixedGroup, getPrefixedName, getPrefixedUser, getSimpleName, getType, hashCode, isEnabled, isGroup, isUser, readPrefixedPrincipal, readPrincipal, readPrincipal, readPrincipal, readPrincipalIncludingHistory, setDescription, setEnabled, setFlags, setName
-
Constructor Details
-
CmsRoleAsPrincipal
Creates a new instane.- Parameters:
role
- the wrapped role
-
-
Method Details
-
checkName
Description copied from interface:I_CmsPrincipal
Checks if the provided principal name is valid and can be used as an argument value forI_CmsPrincipal.setName(String)
.- Parameters:
name
- the principal name to check- See Also:
-
getDescription
Description copied from interface:I_CmsPrincipal
Returns the description of this principal.- Parameters:
locale
- locale of the description- Returns:
- the description of this principal
- See Also:
-
getDisplayName
Description copied from class:CmsPrincipal
Returns the display name of this principal including the organizational unit.- Overrides:
getDisplayName
in classCmsPrincipal
- Parameters:
cms
- the cms contextlocale
- the locale- Returns:
- the display name of this principal including the organizational unit
- See Also:
-
getDisplayName
Description copied from class:CmsPrincipal
Returns the translated display name of this principal if it is a group and the display name otherwise.- Overrides:
getDisplayName
in classCmsPrincipal
- Parameters:
cms
- the current CMS contextlocale
- the localetranslation
- the group name translation to use- Returns:
- the translated display name
- See Also:
-
getRole
Gets the wrapped role.- Returns:
- the wrapped role
-