function social_book_update_8001 in Open Social 8.9
Same name and namespace in other branches
- 8 modules/social_features/social_book/social_book.install \social_book_update_8001()
- 8.2 modules/social_features/social_book/social_book.install \social_book_update_8001()
- 8.3 modules/social_features/social_book/social_book.install \social_book_update_8001()
- 8.4 modules/social_features/social_book/social_book.install \social_book_update_8001()
- 8.5 modules/social_features/social_book/social_book.install \social_book_update_8001()
- 8.6 modules/social_features/social_book/social_book.install \social_book_update_8001()
- 8.7 modules/social_features/social_book/social_book.install \social_book_update_8001()
- 8.8 modules/social_features/social_book/social_book.install \social_book_update_8001()
- 10.3.x modules/social_features/social_book/social_book.install \social_book_update_8001()
- 10.0.x modules/social_features/social_book/social_book.install \social_book_update_8001()
- 10.1.x modules/social_features/social_book/social_book.install \social_book_update_8001()
- 10.2.x modules/social_features/social_book/social_book.install \social_book_update_8001()
Enable book page creation permissions for CM and SM.
File
- modules/
social_features/ social_book/ social_book.install, line 101 - Install, update and uninstall functions for the social_book module.
Code
function social_book_update_8001() {
$roles = Role::loadMultiple();
$permissions = [
'create new books',
'add content to books',
'create book content',
'delete any book content',
'delete own book content',
'delete book revisions',
'revert book revisions',
'edit any book content',
'edit own book content',
'view book revisions',
];
/** @var \Drupal\user\Entity\Role $role */
foreach ($roles as $role) {
if ($role
->id() === 'contentmanager' || $role
->id() === 'sitemanager') {
user_role_grant_permissions($role
->id(), $permissions);
}
}
}