public function Account::hasPermission in Service Container 7
Same name and namespace in other branches
- 7.2 src/Session/Account.php \Drupal\service_container\Session\Account::hasPermission()
Checks whether a user has a certain permission.
Parameters
string $permission: The permission string to check.
Return value
bool TRUE if the user has the permission, FALSE otherwise.
Overrides AccountInterface::hasPermission
File
- src/
Session/ Account.php, line 71 - Contains \Drupal\service_container\Session\Account.
Class
- Account
- Wraps the global user to provide the account interface.
Namespace
Drupal\service_container\SessionCode
public function hasPermission($permission) {
return $this->drupal7
->user_access($permission, $GLOBALS['user']);
}