class NodePrivilegeContext (View source)

An Eel context matching expression for the node privileges

Properties

protected Context $securityContext
protected ContentRepositoryRegistry $contentRepositoryRegistry
protected $node
protected $subgraph

Methods

__construct(Node $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).

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
resolveNodePathOrResult(string $nodePathOrIdentifier)

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

Details

__construct(Node $node)

No description

Parameters

Node $node

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 resolveNodePathOrResult(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