Mercurial > hg > isophonics-drupal-site
annotate core/modules/block_content/src/Access/DependentAccessInterface.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 129ea1e6d783 |
children |
rev | line source |
---|---|
Chris@17 | 1 <?php |
Chris@17 | 2 |
Chris@17 | 3 namespace Drupal\block_content\Access; |
Chris@17 | 4 |
Chris@17 | 5 /** |
Chris@17 | 6 * Interface for AccessibleInterface objects that have an access dependency. |
Chris@17 | 7 * |
Chris@17 | 8 * Objects should implement this interface when their access depends on access |
Chris@17 | 9 * to another object that implements \Drupal\Core\Access\AccessibleInterface. |
Chris@17 | 10 * This interface simply provides the getter method for the access |
Chris@17 | 11 * dependency object. Objects that implement this interface are responsible for |
Chris@17 | 12 * checking access of the access dependency because the dependency may not take |
Chris@17 | 13 * effect in all cases. For instance an entity may only need the access |
Chris@17 | 14 * dependency set when it is embedded within another entity and its access |
Chris@17 | 15 * should be dependent on access to the entity in which it is embedded. |
Chris@17 | 16 * |
Chris@17 | 17 * To check the access to the dependency the object implementing this interface |
Chris@17 | 18 * can use code like this: |
Chris@17 | 19 * @code |
Chris@17 | 20 * $accessible->getAccessDependency()->access($op, $account, TRUE); |
Chris@17 | 21 * @endcode |
Chris@17 | 22 * |
Chris@17 | 23 * @internal |
Chris@17 | 24 */ |
Chris@17 | 25 interface DependentAccessInterface { |
Chris@17 | 26 |
Chris@17 | 27 /** |
Chris@17 | 28 * Gets the access dependency. |
Chris@17 | 29 * |
Chris@17 | 30 * @return \Drupal\Core\Access\AccessibleInterface|null |
Chris@17 | 31 * The access dependency or NULL if none has been set. |
Chris@17 | 32 */ |
Chris@17 | 33 public function getAccessDependency(); |
Chris@17 | 34 |
Chris@17 | 35 } |