Package org.opencms.ade.contenteditor
Class CmsAccessRestrictionInfo
- java.lang.Object
-
- org.opencms.ade.contenteditor.CmsAccessRestrictionInfo
-
public class CmsAccessRestrictionInfo extends java.lang.Object
Class for representing information about a 'restriction' field defined in a schema.
-
-
Field Summary
Fields Modifier and Type Field Description static CmsRole
ROLE_CAN_IGNORE_GROUP
The role that can ignore group membership for manipulating the 'restricted' status.
-
Constructor Summary
Constructors Constructor Description CmsAccessRestrictionInfo(java.lang.String path, CmsGroup group)
Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
collectTypesByPath(CmsXmlContentDefinition definition, java.lang.String path, java.util.Map<java.lang.String,I_CmsXmlSchemaType> typesByPath)
Helper method for collecting all nested schema types of a content definition in a map.CmsGroup
getGroup()
Gets the restriction group.java.lang.String
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 Detail
-
ROLE_CAN_IGNORE_GROUP
public static final CmsRole ROLE_CAN_IGNORE_GROUP
The role that can ignore group membership for manipulating the 'restricted' status.
-
-
Constructor Detail
-
CmsAccessRestrictionInfo
public CmsAccessRestrictionInfo(java.lang.String path, CmsGroup group)
Creates a new instance.- Parameters:
path
- the xpath for the restriction field in the schemagroup
- the restriction group
-
-
Method Detail
-
collectTypesByPath
public static void collectTypesByPath(CmsXmlContentDefinition definition, java.lang.String path, java.util.Map<java.lang.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
-
getPath
public java.lang.String getPath()
Gets the xpath of the restriction field.- Returns:
- the xpath of the restriction field
-
-