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