You are here

function social_profile_update_8003 in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_profile/social_profile.install \social_profile_update_8003()
  2. 8.2 modules/social_features/social_profile/social_profile.install \social_profile_update_8003()
  3. 8.3 modules/social_features/social_profile/social_profile.install \social_profile_update_8003()
  4. 8.4 modules/social_features/social_profile/social_profile.install \social_profile_update_8003()
  5. 8.5 modules/social_features/social_profile/social_profile.install \social_profile_update_8003()
  6. 8.6 modules/social_features/social_profile/social_profile.install \social_profile_update_8003()
  7. 8.7 modules/social_features/social_profile/social_profile.install \social_profile_update_8003()
  8. 8.8 modules/social_features/social_profile/social_profile.install \social_profile_update_8003()
  9. 10.3.x modules/social_features/social_profile/social_profile.install \social_profile_update_8003()
  10. 10.0.x modules/social_features/social_profile/social_profile.install \social_profile_update_8003()
  11. 10.1.x modules/social_features/social_profile/social_profile.install \social_profile_update_8003()
  12. 10.2.x modules/social_features/social_profile/social_profile.install \social_profile_update_8003()

Add social_profile.settings config. Update permissions for SM role.

File

modules/social_features/social_profile/social_profile.install, line 190
Install, update and uninstall functions for the social_profile module.

Code

function social_profile_update_8003(&$sandbox) {
  _social_profile_set_default_config();

  // Add permission to view profile email and administer profile settings for
  // sitemanager role.
  $roles = Role::loadMultiple();
  $permissions = [
    'administer profile settings',
    'view profile email',
  ];

  /** @var \Drupal\user\Entity\Role $role */
  foreach ($roles as $role) {
    if ($role
      ->id() === 'sitemanager') {
      user_role_grant_permissions($role
        ->id(), $permissions);
    }
  }
}