public function PermissionHandler::moduleProvidesPermissions in Drupal 10
Same name and namespace in other branches
- 8 core/modules/user/src/PermissionHandler.php \Drupal\user\PermissionHandler::moduleProvidesPermissions()
- 9 core/modules/user/src/PermissionHandler.php \Drupal\user\PermissionHandler::moduleProvidesPermissions()
File
- core/
modules/ user/ src/ PermissionHandler.php, line 120
Class
- PermissionHandler
- Provides the available permissions based on yml files.
Namespace
Drupal\userCode
public function moduleProvidesPermissions($module_name) {
// @TODO Static cache this information, see
// https://www.drupal.org/node/2339487
$permissions = $this
->getPermissions();
foreach ($permissions as $permission) {
if ($permission['provider'] == $module_name) {
return TRUE;
}
}
return FALSE;
}