comparison core/modules/block_content/src/Access/DependentAccessInterface.php @ 17:129ea1e6d783

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