function social_group_update_8009 in Open Social 8.2
Same name and namespace in other branches
- 8.9 modules/social_features/social_group/social_group.install \social_group_update_8009()
- 8 modules/social_features/social_group/social_group.install \social_group_update_8009()
- 8.3 modules/social_features/social_group/social_group.install \social_group_update_8009()
- 8.4 modules/social_features/social_group/social_group.install \social_group_update_8009()
- 8.5 modules/social_features/social_group/social_group.install \social_group_update_8009()
- 8.6 modules/social_features/social_group/social_group.install \social_group_update_8009()
- 8.7 modules/social_features/social_group/social_group.install \social_group_update_8009()
- 8.8 modules/social_features/social_group/social_group.install \social_group_update_8009()
- 10.3.x modules/social_features/social_group/social_group.install \social_group_update_8009()
- 10.0.x modules/social_features/social_group/social_group.install \social_group_update_8009()
- 10.1.x modules/social_features/social_group/social_group.install \social_group_update_8009()
- 10.2.x modules/social_features/social_group/social_group.install \social_group_update_8009()
Set the default group configuration and permission for sitemanager.
File
- modules/
social_features/ social_group/ social_group.install, line 320 - Install, update and uninstall functions for the social_group module.
Code
function social_group_update_8009() {
_social_group_set_default_configuration();
// Site manager should have permission to set social group settings.
$roles = Role::loadMultiple();
/** @var \Drupal\user\Entity\Role $role */
foreach ($roles as $role) {
if ($role
->id() !== 'sitemanager') {
continue;
}
$permissions = [
'set social group settings',
];
user_role_grant_permissions($role
->id(), $permissions);
}
}