Package org.opencms.security
Class CmsRoleAsPrincipal
- java.lang.Object
-
- org.opencms.security.CmsPrincipal
-
- org.opencms.security.CmsRoleAsPrincipal
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<I_CmsPrincipal>
,java.security.Principal
,I_CmsPrincipal
public class CmsRoleAsPrincipal extends CmsPrincipal
Wrapper around CmsRole objects so they can be used as principals.- See Also:
- Serialized Form
-
-
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
Constructors Constructor Description CmsRoleAsPrincipal(CmsRole role)
Creates a new instane.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkName(java.lang.String name)
Checks if the provided principal name is valid and can be used as an argument value forI_CmsPrincipal.setName(String)
.java.lang.String
getDescription(java.util.Locale locale)
Returns the description of this principal.java.lang.String
getDisplayName(CmsObject cms, java.util.Locale locale)
Returns the display name of this principal including the organizational unit.java.lang.String
getDisplayName(CmsObject cms, java.util.Locale locale, I_CmsGroupNameTranslation translation)
Returns the translated display name of this principal if it is a group and the display name otherwise.CmsRole
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 Detail
-
CmsRoleAsPrincipal
public CmsRoleAsPrincipal(CmsRole role)
Creates a new instane.- Parameters:
role
- the wrapped role
-
-
Method Detail
-
checkName
public void checkName(java.lang.String name)
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:
I_CmsPrincipal.checkName(java.lang.String)
-
getDescription
public java.lang.String getDescription(java.util.Locale locale)
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:
I_CmsPrincipal.getDescription(java.util.Locale)
-
getDisplayName
public java.lang.String getDisplayName(CmsObject cms, java.util.Locale locale)
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:
CmsPrincipal.getDisplayName(org.opencms.file.CmsObject, java.util.Locale)
-
getDisplayName
public java.lang.String getDisplayName(CmsObject cms, java.util.Locale locale, I_CmsGroupNameTranslation translation)
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:
CmsPrincipal.getDisplayName(org.opencms.file.CmsObject, java.util.Locale, org.opencms.workplace.I_CmsGroupNameTranslation)
-
-