function PermissionCheckerInterface::hasPermission

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Session/PermissionCheckerInterface.php \Drupal\Core\Session\PermissionCheckerInterface::hasPermission()

Checks whether an account has a permission.

Parameters

string $permission: The name of the permission to check for.

\Drupal\Core\Session\AccountInterface $account: The user account for which to check the permissions.

Return value

bool Whether the account has the permission.

File

core/lib/Drupal/Core/Session/PermissionCheckerInterface.php, line 27

Class

PermissionCheckerInterface
Defines a permission checker interface.

Namespace

Drupal\Core\Session

Code

public function hasPermission(string $permission, AccountInterface $account) : bool;

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.