interface RefinableDependentAccessInterface

An interface to allow adding an access dependency.

@internal

Hierarchy

Expanded class hierarchy of RefinableDependentAccessInterface

All classes that implement RefinableDependentAccessInterface

1 file declares its use of RefinableDependentAccessInterface
DependentAccessTest.php in core/tests/Drupal/Tests/Core/Access/DependentAccessTest.php

File

core/lib/Drupal/Core/Access/RefinableDependentAccessInterface.php, line 10

Namespace

Drupal\Core\Access
View source
interface RefinableDependentAccessInterface extends DependentAccessInterface {
  
  /**
   * Sets the access dependency.
   *
   * If an access dependency is already set this will replace the existing
   * dependency.
   *
   * @param \Drupal\Core\Access\AccessibleInterface $access_dependency
   *   The object upon which access depends.
   *
   * @return $this
   */
  public function setAccessDependency(AccessibleInterface $access_dependency);
  
  /**
   * 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.
   *
   * @param \Drupal\Core\Access\AccessibleInterface $access_dependency
   *   The access dependency to merge.
   *
   * @return $this
   */
  public function addAccessDependency(AccessibleInterface $access_dependency);

}

Members

Title Sort descending Modifiers Object type Summary
DependentAccessInterface::getAccessDependency public function Gets the access dependency.
RefinableDependentAccessInterface::addAccessDependency public function Adds an access dependency into the existing access dependency.
RefinableDependentAccessInterface::setAccessDependency public function Sets the access dependency.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.