3 namespace Drupal\Core\Access;
5 use Drupal\Core\Session\AccountInterface;
8 * Interface for checking access.
12 interface AccessibleInterface {
15 * Checks data value access.
17 * @param string $operation
18 * The operation to be performed.
19 * @param \Drupal\Core\Session\AccountInterface $account
20 * (optional) The user for which to check access, or NULL to check access
21 * for the current user. Defaults to NULL.
22 * @param bool $return_as_object
23 * (optional) Defaults to FALSE.
25 * @return bool|\Drupal\Core\Access\AccessResultInterface
26 * The access result. Returns a boolean if $return_as_object is FALSE (this
27 * is the default) and otherwise an AccessResultInterface object.
28 * When a boolean is returned, the result of AccessInterface::isAllowed() is
29 * returned, i.e. TRUE means access is explicitly allowed, FALSE means
30 * access is either explicitly forbidden or "no opinion".
32 public function access($operation, AccountInterface $account = NULL, $return_as_object = FALSE);