AccessResultForbidden::setReason

public AccessResultForbidden::setReason($reason) Sets the reason for this access result. Parameters $reason string|null: The reason of this access result or NULL if no reason is provided. Return value \Drupal\Core\Access\AccessResultInterface The access result instance. Overrides AccessResultReasonInterface::setReason File core/lib/Drupal/Core/Access/AccessResultForbidden.php, line 45 Class AccessResultForbidden Value object indicating a forbidden access result, with cacheability metadat

AccessResultForbidden::isForbidden

public AccessResultForbidden::isForbidden() Overrides AccessResult::isForbidden See also \Drupal\Core\Access\AccessResultForbidden File core/lib/Drupal/Core/Access/AccessResultForbidden.php, line 31 Class AccessResultForbidden Value object indicating a forbidden access result, with cacheability metadata. Namespace Drupal\Core\Access Code public function isForbidden() { return TRUE; }

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 interface \Drupal\Core\Access\AccessResultInterface File core/lib/Drupal/Core/Access/AccessResultInterface.php, line 21 Namespace Drupal\Core\Access Me

AccessResultForbidden::__construct

public AccessResultForbidden::__construct($reason = NULL) Constructs a new AccessResultForbidden instance. Parameters null|string $reason: (optional) a message to provide details about this access result File core/lib/Drupal/Core/Access/AccessResultForbidden.php, line 23 Class AccessResultForbidden Value object indicating a forbidden access result, with cacheability metadata. Namespace Drupal\Core\Access Code public function __construct($reason = NULL) { $this->reason = $reason;

AccessResultInterface::andIf

public AccessResultInterface::andIf(AccessResultInterface $other) Combine this access result with another using AND. When AND-ing two access results, the result is: isForbidden() in either ⇒ isForbidden() otherwise, if isAllowed() in both ⇒ isAllowed() otherwise, one of them is isNeutral() ⇒ isNeutral() Truth table: |A N F --+----- A |A N F N |N N F F |F F F Parameters \Drupal\Core\Access\AccessResultInterface $other: The other access result to AND this one with. Return value static File

AccessResultInterface::isForbidden

public AccessResultInterface::isForbidden() Checks whether this access result indicates access is explicitly forbidden. This is a kill switch — both orIf() and andIf() will result in isForbidden() if either results are isForbidden(). Return value bool When TRUE then isAllowed() and isNeutral() are FALSE. File core/lib/Drupal/Core/Access/AccessResultInterface.php, line 40 Class AccessResultInterface Interface for access result value objects. Namespace Drupal\Core\Access Code public fun

AccessResultForbidden::getReason

public AccessResultForbidden::getReason() Gets the reason for this access result. Return value string|null The reason of this access result or NULL if no reason is provided. Overrides AccessResultReasonInterface::getReason File core/lib/Drupal/Core/Access/AccessResultForbidden.php, line 38 Class AccessResultForbidden Value object indicating a forbidden access result, with cacheability metadata. Namespace Drupal\Core\Access Code public function getReason() { return $this->reason;

AccessResultForbidden

Value object indicating a forbidden access result, with cacheability metadata. Hierarchy class \Drupal\Core\Access\AccessResult implements AccessResultInterface, RefinableCacheableDependencyInterface uses RefinableCacheableDependencyTraitclass \Drupal\Core\Access\AccessResultForbidden implements AccessResultReasonInterface File core/lib/Drupal/Core/Access/AccessResultForbidden.php, line 8 Namespace Drupal\Core\Access Members Name Modifiers Type Description AccessResult::allow

AccessResultForbidden::$reason

The reason why access is forbidden. For use in error messages. Type: string|null File core/lib/Drupal/Core/Access/AccessResultForbidden.php, line 15 Class AccessResultForbidden Value object indicating a forbidden access result, with cacheability metadata. Namespace Drupal\Core\Access Code protected $reason;

AccessResultAllowed

Value object indicating an allowed access result, with cacheability metadata. Hierarchy class \Drupal\Core\Access\AccessResult implements AccessResultInterface, RefinableCacheableDependencyInterface uses RefinableCacheableDependencyTraitclass \Drupal\Core\Access\AccessResultAllowed File core/lib/Drupal/Core/Access/AccessResultAllowed.php, line 8 Namespace Drupal\Core\Access Members Name Modifiers Type Description AccessResult::allowed public static function Creates an A