You are here

function social_group_update_8009 in Open Social 8.2

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_group/social_group.install \social_group_update_8009()
  2. 8 modules/social_features/social_group/social_group.install \social_group_update_8009()
  3. 8.3 modules/social_features/social_group/social_group.install \social_group_update_8009()
  4. 8.4 modules/social_features/social_group/social_group.install \social_group_update_8009()
  5. 8.5 modules/social_features/social_group/social_group.install \social_group_update_8009()
  6. 8.6 modules/social_features/social_group/social_group.install \social_group_update_8009()
  7. 8.7 modules/social_features/social_group/social_group.install \social_group_update_8009()
  8. 8.8 modules/social_features/social_group/social_group.install \social_group_update_8009()
  9. 10.3.x modules/social_features/social_group/social_group.install \social_group_update_8009()
  10. 10.0.x modules/social_features/social_group/social_group.install \social_group_update_8009()
  11. 10.1.x modules/social_features/social_group/social_group.install \social_group_update_8009()
  12. 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);
  }
}