You are here

public function RefinableDependentAccessInterface::addAccessDependency in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/block_content/src/Access/RefinableDependentAccessInterface.php \Drupal\block_content\Access\RefinableDependentAccessInterface::addAccessDependency()
  2. 9 core/modules/block_content/src/Access/RefinableDependentAccessInterface.php \Drupal\block_content\Access\RefinableDependentAccessInterface::addAccessDependency()

Adds an access dependency into the existing access dependency.

If no existing dependency is currently set this will set the dependency will be set to the new value.

If there is an existing dependency and it is not an instance of AccessGroupAnd the dependency will be set as a new AccessGroupAnd instance with the existing and new dependencies as the members of the group.

If there is an existing dependency and it is an instance of AccessGroupAnd the dependency will be added to the existing access group.

Parameters

\Drupal\Core\Access\AccessibleInterface $access_dependency: The access dependency to merge.

Return value

$this

File

core/modules/block_content/src/Access/RefinableDependentAccessInterface.php, line 46

Class

RefinableDependentAccessInterface
An interface to allow adding an access dependency.

Namespace

Drupal\block_content\Access

Code

public function addAccessDependency(AccessibleInterface $access_dependency);