function userprotect_install in User protect 8
Same name and namespace in other branches
- 5 userprotect.install \userprotect_install()
- 6 userprotect.install \userprotect_install()
- 7 userprotect.install \userprotect_install()
Implements hook_install().
Installs default userprotect permissions for authenticated users.
File
- ./
userprotect.install, line 15 - Install, update and uninstall functions for the userprotect module.
Code
function userprotect_install() {
$role = \Drupal::entityTypeManager()
->getStorage('user_role')
->load(AccountInterface::AUTHENTICATED_ROLE);
$role
->grantPermission('userprotect.mail.edit');
$role
->grantPermission('userprotect.pass.edit');
$role
->grantPermission('userprotect.account.edit');
$role
->save();
}