
| Current Path : /var/www/html/rocksensor/web/core/lib/Drupal/Core/Session/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/rocksensor/web/core/lib/Drupal/Core/Session/PermissionCheckerInterface.php |
<?php
namespace Drupal\Core\Session;
/**
* Defines a permission checker interface.
*
* This service checks if a role has a permission. It can be swapped out or
* decorated to allow for more complex logic. If you do so, ensure that you
* provide ample automated tests so your site remains secure.
*
* @ingroup user_api
*/
interface PermissionCheckerInterface {
/**
* Checks whether an account has a permission.
*
* @param string $permission
* The name of the permission to check for.
* @param \Drupal\Core\Session\AccountInterface $account
* The user account for which to check the permissions.
*
* @return bool
* Whether the account has the permission.
*/
public function hasPermission(string $permission, AccountInterface $account): bool;
}