Package org.opencms.ade.contenteditor
Class CmsAccessRestrictionInfo
java.lang.Object
org.opencms.ade.contenteditor.CmsAccessRestrictionInfo
Class for representing information about a 'restriction' field defined in a schema.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final CmsRole
The role that can ignore group membership for manipulating the 'restricted' status. -
Constructor Summary
ConstructorDescriptionCmsAccessRestrictionInfo
(String path, CmsGroup group) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
collectTypesByPath
(CmsXmlContentDefinition definition, String path, Map<String, I_CmsXmlSchemaType> typesByPath) Helper method for collecting all nested schema types of a content definition in a map.getGroup()
Gets the restriction group.getPath()
Gets the xpath of the restriction field.static CmsAccessRestrictionInfo
getRestrictionInfo
(CmsObject cms, CmsXmlContentDefinition contentDef) Gets the restriction info for the current user and content definition.
-
Field Details
-
ROLE_CAN_IGNORE_GROUP
The role that can ignore group membership for manipulating the 'restricted' status.
-
-
Constructor Details
-
CmsAccessRestrictionInfo
Creates a new instance.- Parameters:
path
- the xpath for the restriction field in the schemagroup
- the restriction group
-
-
Method Details
-
collectTypesByPath
public static void collectTypesByPath(CmsXmlContentDefinition definition, String path, Map<String, I_CmsXmlSchemaType> typesByPath) Helper method for collecting all nested schema types of a content definition in a map.The map keys in the resulting map will be the xpaths corresponding to the schema types.
- Parameters:
definition
- a content definitionpath
- the path to start withtypesByPath
- the map in which the schema types should be stored
-
getRestrictionInfo
public static CmsAccessRestrictionInfo getRestrictionInfo(CmsObject cms, CmsXmlContentDefinition contentDef) Gets the restriction info for the current user and content definition.This will only return a non-null value if the is restriction field defined in the content definition and the current user is in the group configured as the restriction group for that field.
- Parameters:
cms
- the current CMS contextcontentDef
- the content definition- Returns:
- the restriction information
-
getGroup
Gets the restriction group.- Returns:
- the restriction group
-
getPath
Gets the xpath of the restriction field.- Returns:
- the xpath of the restriction field
-