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.
doc_Drupal
2016-10-29 08:42:35
Comments
Leave a Comment

Please login to continue.