PermissionChecker.php
Namespace
Drupal\Core\SessionFile
- 
              core/
lib/ Drupal/ Core/ Session/ PermissionChecker.php  
View source
<?php
namespace Drupal\Core\Session;
/**
 * Checks permissions for an account.
 */
class PermissionChecker implements PermissionCheckerInterface {
  public function __construct(protected AccessPolicyProcessorInterface $processor) {
  }
  
  /**
   * {@inheritdoc}
   */
  public function hasPermission(string $permission, AccountInterface $account) : bool {
    $item = $this->processor
      ->processAccessPolicies($account)
      ->getItem();
    return $item && $item->hasPermission($permission);
  }
}
Classes
| Title | Deprecated | Summary | 
|---|---|---|
| PermissionChecker | Checks permissions for an account. | 
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.