You are here

function external_link_popup_update_8106 in External Link Pop-up 8

Update permissions.

File

./external_link_popup.install, line 65
Contains external_link_popup installation and upgrade actions.

Code

function external_link_popup_update_8106() {

  /** @var \Drupal\user\RoleInterface $role */
  foreach (\Drupal::entityTypeManager()
    ->getStorage('user_role')
    ->loadMultiple() as $role) {
    if ($role
      ->hasPermission('administer site configuration')) {
      $role
        ->grantPermission('administer external link popup');
    }
    $role
      ->save();
  }
}