You are here

function social_user_update_8008 in Open Social 10.1.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_user/social_user.install \social_user_update_8008()
  2. 8.5 modules/social_features/social_user/social_user.install \social_user_update_8008()
  3. 8.6 modules/social_features/social_user/social_user.install \social_user_update_8008()
  4. 8.7 modules/social_features/social_user/social_user.install \social_user_update_8008()
  5. 8.8 modules/social_features/social_user/social_user.install \social_user_update_8008()
  6. 10.3.x modules/social_features/social_user/social_user.install \social_user_update_8008()
  7. 10.0.x modules/social_features/social_user/social_user.install \social_user_update_8008()
  8. 10.2.x modules/social_features/social_user/social_user.install \social_user_update_8008()

Create the default configuration for the social_user default landing page.

File

modules/social_features/social_user/social_user.install, line 116
Install, update and uninstall functions for the social_user module.

Code

function social_user_update_8008() {

  // Create the default configuration for the social_user default landing page.
  $config = \Drupal::getContainer()
    ->get('config.factory')
    ->getEditable('social_user.settings');
  $config
    ->set('social_user_profile_landingpage', 'entity.user.canonical')
    ->save();

  // Add permissions for sitemanager to administer social user settings.
  $role = Role::load('sitemanager');
  if ($role instanceof RoleInterface) {
    user_role_grant_permissions($role
      ->id(), [
      'administer social_user settings',
    ]);
  }
}