class PropertyAwareNodePrivilegeContext extends NodePrivilegeContext (View source)

An Eel context matching expression for the node privileges including node properties.

Properties

protected TransientNodeCache $transientNodeCache from  NodePrivilegeContext
protected ContextFactory $contextFactory from  NodePrivilegeContext
protected Context $securityContext from  NodePrivilegeContext
protected ContentDimensionPresetSourceInterface $contentDimensionPresetSource from  NodePrivilegeContext
protected NodeInterface $node from  NodePrivilegeContext
protected array $propertyNames

Methods

__construct(NodeInterface $node = null)

No description

void
setNode(NodeInterface $node)

No description

bool
isAncestorNodeOf(string $nodePathOrIdentifier)

Matches if the selected node is an ancestor of the given node specified by $nodePathOrIdentifier

bool
isDescendantNodeOf(string $nodePathOrIdentifier)

Matches if the selected node is a descendant of the given node specified by $nodePathOrIdentifier

bool
isAncestorOrDescendantNodeOf(string $nodePathOrIdentifier)

Matches if the selected node is a descendant or ancestor of the given node specified by $nodePathOrIdentifier

bool
nodeIsOfType(string|array $nodeTypes)

Matches if the selected node is of the given NodeType(s). If multiple types are specified, only one entry has to match

bool
isInWorkspace(array $workspaceNames)

Matches if the selected node belongs to one of the given $workspaceNames

bool
isInDimensionPreset(string $dimensionName, string|array $presets)

Matches if the currently-selected preset in the passed $dimensionName is one of $presets.

bool|string
resolveNodePath(string $nodePathOrIdentifier)

Resolves the given $nodePathOrIdentifier and returns its absolute path and or a boolean if the result directly matches the currently selected node

getNodeByIdentifier(string $nodeIdentifier)

Returns a node from the given $nodeIdentifier (disabling authorization checks)

bool
nodePropertyIsIn(string|array $propertyNames)

No description

array
getNodePropertyNames()

No description

bool
hasProperties()

Whether or not this context is bound to specific properties

Details

__construct(NodeInterface $node = null)

No description

Parameters

NodeInterface $node

void setNode(NodeInterface $node)

No description

Parameters

NodeInterface $node

Return Value

void

bool isAncestorNodeOf(string $nodePathOrIdentifier)

Matches if the selected node is an ancestor of the given node specified by $nodePathOrIdentifier

Example: isAncestorNodeOf('/sites/some/path') matches for the nodes "/sites", "/sites/some" and "/sites/some/path" but not for "/sites/some/other"

Parameters

string $nodePathOrIdentifier

The identifier or absolute path of the node to match

Return Value

bool

true if the given node matches otherwise false

bool isDescendantNodeOf(string $nodePathOrIdentifier)

Matches if the selected node is a descendant of the given node specified by $nodePathOrIdentifier

Example: isDescendantNodeOf('/sites/some/path') matches for the nodes "/sites/some/path", "/sites/some/path/subnode" but not for "/sites/some/other"

Parameters

string $nodePathOrIdentifier

The identifier or absolute path of the node to match

Return Value

bool

true if the given node matches otherwise false

bool isAncestorOrDescendantNodeOf(string $nodePathOrIdentifier)

Matches if the selected node is a descendant or ancestor of the given node specified by $nodePathOrIdentifier

Example: isAncestorOrDescendantNodeOf('/sites/some') matches for the nodes "/sites", "/sites/some", "/sites/some/sub" but not "/sites/other"

Parameters

string $nodePathOrIdentifier

The identifier or absolute path of the node to match

Return Value

bool

true if the given node matches otherwise false

bool nodeIsOfType(string|array $nodeTypes)

Matches if the selected node is of the given NodeType(s). If multiple types are specified, only one entry has to match

Example: nodeIsOfType(['Neos.ContentRepository:NodeType1', 'Neos.ContentRepository:NodeType2']) matches if the selected node is of (sub) type Neos.ContentRepository:NodeType1 or Neos.ContentRepository:NodeType1

Parameters

string|array $nodeTypes

A single or an array of fully qualified NodeType name(s), e.g. "Neos.Neos:Document"

Return Value

bool

true if the selected node matches the $nodeTypes, otherwise false

bool isInWorkspace(array $workspaceNames)

Matches if the selected node belongs to one of the given $workspaceNames

Example: isInWorkspace(['live', 'user-admin']) matches if the selected node is in one of the workspaces "user-admin" or "live"

Parameters

array $workspaceNames

An array of workspace names, e.g. ["live", "user-admin"]

Return Value

bool

true if the selected node matches the $workspaceNames, otherwise false

bool isInDimensionPreset(string $dimensionName, string|array $presets)

Matches if the currently-selected preset in the passed $dimensionName is one of $presets.

Example: isInDimensionPreset('language', 'de') checks whether the currently-selected language preset (in the Neos backend) is "de".

Implementation Note: We deliberately work on the Dimension Preset Name, and not on the dimension values itself; as the preset is user-visible and the actual dimension-values for a preset are just implementation details.

Parameters

string $dimensionName
string|array $presets

Return Value

bool

protected bool|string resolveNodePath(string $nodePathOrIdentifier)

Resolves the given $nodePathOrIdentifier and returns its absolute path and or a boolean if the result directly matches the currently selected node

Parameters

string $nodePathOrIdentifier

identifier or absolute path for the node to resolve

Return Value

bool|string

true if the node matches the selected node, false if the corresponding node does not exist. Otherwise the resolved absolute path with trailing slash

protected NodeInterface getNodeByIdentifier(string $nodeIdentifier)

Returns a node from the given $nodeIdentifier (disabling authorization checks)

Parameters

string $nodeIdentifier

Return Value

NodeInterface

bool nodePropertyIsIn(string|array $propertyNames)

No description

Parameters

string|array $propertyNames

Return Value

bool

array getNodePropertyNames()

No description

Return Value

array

bool hasProperties()

Whether or not this context is bound to specific properties

Return Value

bool