W3cubDocs

/Drupal 8

interface AccessResultInterface

Interface for access result value objects.

IMPORTANT NOTE: You have to call isAllowed() when you want to know whether someone has access. Just using

if ($access_result) {
  // The user has access!
}
else {
  // The user doesn't have access!
}

would never enter the else-statement and hence introduce a critical security issue.

Hierarchy

File

core/lib/Drupal/Core/Access/AccessResultInterface.php, line 21

Namespace

Drupal\Core\Access

Members

Name Modifiers Type Description
AccessResultInterface::andIf public function Combine this access result with another using AND.
AccessResultInterface::isAllowed public function Checks whether this access result indicates access is explicitly allowed.
AccessResultInterface::isForbidden public function Checks whether this access result indicates access is explicitly forbidden.
AccessResultInterface::isNeutral public function Checks whether this access result indicates access is not yet determined.
AccessResultInterface::orIf public function Combine this access result with another using OR.

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Access!AccessResultInterface.php/interface/AccessResultInterface/8.1.x