class AuthorizationService (View source)

This service provides API methods to check for privileges on nodes and permissions for node actions.

Properties

protected Context $securityContext
protected PrivilegeManagerInterface $privilegeManager
protected NodeTypeManager $nodeTypeManager

Methods

bool
isGrantedToEditNode(NodeInterface $node)

Returns true if the currently authenticated user is allowed to edit the given $node, otherwise false

bool
isGrantedToCreateNode(NodeInterface $referenceNode, NodeType $typeOfNewNode = null)

Returns true if the currently authenticated user is allowed to create a node of type $typeOfNewNode within the given $referenceNode

string[]
getNodeTypeNamesDeniedForCreation(NodeInterface $referenceNode)

Returns the node types that the currently authenticated user is denied to create within the given $referenceNode

bool
isGrantedToRemoveNode(NodeInterface $node)

Returns true if the currently authenticated user is allowed to remove the given $node

bool
isGrantedToReadNodeProperty(NodeInterface $node, string $propertyName)

No description

bool
isGrantedToEditNodeProperty(NodeInterface $node, string $propertyName)

No description

string[]

Details

bool isGrantedToEditNode(NodeInterface $node)

Returns true if the currently authenticated user is allowed to edit the given $node, otherwise false

Parameters

NodeInterface $node

Return Value

bool

bool isGrantedToCreateNode(NodeInterface $referenceNode, NodeType $typeOfNewNode = null)

Returns true if the currently authenticated user is allowed to create a node of type $typeOfNewNode within the given $referenceNode

Parameters

NodeInterface $referenceNode
NodeType $typeOfNewNode

Return Value

bool

string[] getNodeTypeNamesDeniedForCreation(NodeInterface $referenceNode)

Returns the node types that the currently authenticated user is denied to create within the given $referenceNode

Parameters

NodeInterface $referenceNode

Return Value

string[]

Array of granted node type names

bool isGrantedToRemoveNode(NodeInterface $node)

Returns true if the currently authenticated user is allowed to remove the given $node

Parameters

NodeInterface $node

Return Value

bool

bool isGrantedToReadNodeProperty(NodeInterface $node, string $propertyName)

No description

Parameters

NodeInterface $node
string $propertyName

Return Value

bool

bool isGrantedToEditNodeProperty(NodeInterface $node, string $propertyName)

No description

Parameters

NodeInterface $node
string $propertyName

Return Value

bool

string[] getDeniedNodePropertiesForEditing(NodeInterface $node)

No description

Parameters

NodeInterface $node

Return Value

string[]

Array of granted node property names