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 ContentRepositoryRegistry $contentRepositoryRegistry

Methods

bool
isGrantedToEditNode(Node $node)

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

bool
isGrantedToCreateNode(Node $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(Node $referenceNode)

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

bool
isGrantedToRemoveNode(Node $node)

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

bool
isGrantedToReadNodeProperty(Node $node, string $propertyName)

No description

bool
isGrantedToEditNodeProperty(Node $node, string $propertyName)

No description

string[]
getDeniedNodePropertiesForEditing(Node $node)

No description

Details

bool isGrantedToEditNode(Node $node)

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

Parameters

Node $node

Return Value

bool

bool isGrantedToCreateNode(Node $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

Node $referenceNode
NodeType $typeOfNewNode

Return Value

bool

string[] getNodeTypeNamesDeniedForCreation(Node $referenceNode)

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

Parameters

Node $referenceNode

Return Value

string[]

Array of granted node type names

bool isGrantedToRemoveNode(Node $node)

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

Parameters

Node $node

Return Value

bool

bool isGrantedToReadNodeProperty(Node $node, string $propertyName)

No description

Parameters

Node $node
string $propertyName

Return Value

bool

bool isGrantedToEditNodeProperty(Node $node, string $propertyName)

No description

Parameters

Node $node
string $propertyName

Return Value

bool

string[] getDeniedNodePropertiesForEditing(Node $node)

No description

Parameters

Node $node

Return Value

string[]

Array of granted node property names