class NodeAddAccessCheck implements AccessInterface (View source)

deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use _entity_create_access or _entity_create_any_access access checks instead.

Determines access to for node add pages.

Properties

protected EntityTypeManagerInterface $entityTypeManager

The entity type manager.

Methods

__construct(EntityTypeManagerInterface $entity_type_manager)

Constructs an EntityCreateAccessCheck object.

access(AccountInterface $account, NodeTypeInterface $node_type = NULL)

Checks access to the node add page for the node type.

Details

__construct(EntityTypeManagerInterface $entity_type_manager)

Constructs an EntityCreateAccessCheck object.

Parameters

EntityTypeManagerInterface $entity_type_manager

The entity type manager.

AccessResultInterface access(AccountInterface $account, NodeTypeInterface $node_type = NULL)

Checks access to the node add page for the node type.

Parameters

AccountInterface $account

The currently logged in account.

NodeTypeInterface $node_type

(optional) The node type. If not specified, access is allowed if there exists at least one node type for which the user may create a node.

Return Value

AccessResultInterface

The access result.