PHP Class Neos\ContentRepository\Security\Authorization\Privilege\Node\NodePrivilegeContext

Datei anzeigen Open project: neos/neos-development-collection

Protected Properties

Property Type Description
$contentDimensionPresetSource Neos\ContentRepository\Domain\Service\ContentDimensionPresetSourceInterface
$contextFactory Neos\ContentRepository\Domain\Service\ContextFactory
$node Neos\ContentRepository\Domain\Model\NodeInterface
$securityContext Neos\Flow\Security\Context

Public Methods

Method Description
__construct ( Neos\ContentRepository\Domain\Model\NodeInterface $node = null )
isAncestorNodeOf ( string $nodePathOrIdentifier ) : boolean Matches if the selected node is an *ancestor* of the given node specified by $nodePathOrIdentifier
isAncestorOrDescendantNodeOf ( string $nodePathOrIdentifier ) : boolean Matches if the selected node is a *descendant* or *ancestor* of the given node specified by $nodePathOrIdentifier
isDescendantNodeOf ( string $nodePathOrIdentifier ) : boolean Matches if the selected node is a *descendant* of the given node specified by $nodePathOrIdentifier
isInDimensionPreset ( string $dimensionName, string | array $presets ) : boolean Matches if the currently-selected preset in the passed $dimensionName is one of $presets.
isInWorkspace ( array $workspaceNames ) : boolean Matches if the selected node belongs to one of the given $workspaceNames
nodeIsOfType ( string | array $nodeTypes ) : boolean Matches if the selected node is of the given NodeType(s). If multiple types are specified, only one entry has to match
setNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : void

Protected Methods

Method Description
getNodeByIdentifier ( string $nodeIdentifier ) : Neos\ContentRepository\Domain\Model\NodeInterface Returns a node from the given $nodeIdentifier (disabling authorization checks)
resolveNodePath ( string $nodePathOrIdentifier ) : boolean | string Resolves the given $nodePathOrIdentifier and returns its absolute path and or a boolean if the result directly matches the currently selected node

Method Details

__construct() public method

public __construct ( Neos\ContentRepository\Domain\Model\NodeInterface $node = null )
$node Neos\ContentRepository\Domain\Model\NodeInterface

getNodeByIdentifier() protected method

Returns a node from the given $nodeIdentifier (disabling authorization checks)
protected getNodeByIdentifier ( string $nodeIdentifier ) : Neos\ContentRepository\Domain\Model\NodeInterface
$nodeIdentifier string
return Neos\ContentRepository\Domain\Model\NodeInterface

isAncestorNodeOf() public method

Example: isAncestorNodeOf('/sites/some/path') matches for the nodes "/sites", "/sites/some" and "/sites/some/path" but not for "/sites/some/other"
public isAncestorNodeOf ( string $nodePathOrIdentifier ) : boolean
$nodePathOrIdentifier string The identifier or absolute path of the node to match
return boolean TRUE if the given node matches otherwise false

isAncestorOrDescendantNodeOf() public method

Example: isAncestorOrDescendantNodeOf('/sites/some') matches for the nodes "/sites", "/sites/some", "/sites/some/sub" but not "/sites/other"
public isAncestorOrDescendantNodeOf ( string $nodePathOrIdentifier ) : boolean
$nodePathOrIdentifier string The identifier or absolute path of the node to match
return boolean TRUE if the given node matches otherwise false

isDescendantNodeOf() public method

Example: isDescendantNodeOf('/sites/some/path') matches for the nodes "/sites/some/path", "/sites/some/path/subnode" but not for "/sites/some/other"
public isDescendantNodeOf ( string $nodePathOrIdentifier ) : boolean
$nodePathOrIdentifier string The identifier or absolute path of the node to match
return boolean TRUE if the given node matches otherwise false

isInDimensionPreset() public method

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.
public isInDimensionPreset ( string $dimensionName, string | array $presets ) : boolean
$dimensionName string
$presets string | array
return boolean

isInWorkspace() public method

Example: isInWorkspace(['live', 'user-admin']) matches if the selected node is in one of the workspaces "user-admin" or "live"
public isInWorkspace ( array $workspaceNames ) : boolean
$workspaceNames array An array of workspace names, e.g. ["live", "user-admin"]
return boolean TRUE if the selected node matches the $workspaceNames, otherwise FALSE

nodeIsOfType() public method

Example: nodeIsOfType(['Neos.ContentRepository:NodeType1', 'Neos.ContentRepository:NodeType2']) matches if the selected node is of (sub) type *Neos.ContentRepository:NodeType1* or *Neos.ContentRepository:NodeType1*
public nodeIsOfType ( string | array $nodeTypes ) : boolean
$nodeTypes string | array A single or an array of fully qualified NodeType name(s), e.g. "Neos.Neos:Document"
return boolean TRUE if the selected node matches the $nodeTypes, otherwise FALSE

resolveNodePath() protected method

Resolves the given $nodePathOrIdentifier and returns its absolute path and or a boolean if the result directly matches the currently selected node
protected resolveNodePath ( string $nodePathOrIdentifier ) : boolean | string
$nodePathOrIdentifier string identifier or absolute path for the node to resolve
return boolean | 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

setNode() public method

public setNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface
return void

Property Details

$contentDimensionPresetSource protected_oe property

protected ContentDimensionPresetSourceInterface,Neos\ContentRepository\Domain\Service $contentDimensionPresetSource
return Neos\ContentRepository\Domain\Service\ContentDimensionPresetSourceInterface

$contextFactory protected_oe property

protected ContextFactory,Neos\ContentRepository\Domain\Service $contextFactory
return Neos\ContentRepository\Domain\Service\ContextFactory

$node protected_oe property

protected NodeInterface,Neos\ContentRepository\Domain\Model $node
return Neos\ContentRepository\Domain\Model\NodeInterface

$securityContext protected_oe property

protected Context,Neos\Flow\Security $securityContext
return Neos\Flow\Security\Context