function message_update_8100 in Message 8
Fixes the typo in 'adminster messages' permission.
File
- ./
message.install, line 19 - Install, update, and uninstall functions for the message module.
Code
function message_update_8100() {
$entityTypeManager = \Drupal::service('entity_type.manager');
$roles = $entityTypeManager
->getStorage('user_role')
->loadMultiple();
foreach ($roles as $role) {
if ($role
->hasPermission('adminster messages')) {
$role
->revokePermission('adminster messages');
$role
->grantPermission('administer messages');
$role
->save();
}
}
}