public static AccessResult::forbiddenIf($condition)
Creates a forbidden or neutral access result.
Parameters
bool $condition: The condition to evaluate.
Return value
\Drupal\Core\Access\AccessResult If $condition is TRUE, isForbidden() will be TRUE, otherwise isNeutral() will be TRUE.
File
- core/lib/Drupal/Core/Access/AccessResult.php, line 90
Class
- AccessResult
- Value object for passing an access result with cacheability metadata.
Namespace
Drupal\Core\Access
Code
public static function forbiddenIf($condition) { return $condition ? static::forbidden() : static::neutral(); }
Please login to continue.