Commit ae9d74fc authored by Srishti Bankar's avatar Srishti Bankar Committed by Andrey Postnikov
Browse files

Issue #3257969 by srishtiiee: Migrate masquerade permissions from D7 to D9

parent ab1c7825
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -236,3 +236,18 @@ function masquerade_switch_user_validate(UserInterface $target_account) {
    ]);
  }
}

/**
 * Implements hook_migration_plugins_alter().
 *
 * Names of masquerade permissions changed between Drupal 7 and 8|9. Map the
 * permission names respectively.
 */
function masquerade_migration_plugins_alter(array &$migrations) {
  if (
    !empty($migrations['d7_user_role']['process']['permissions'][0]) &&
    $migrations['d7_user_role']['process']['permissions'][0]['plugin'] === 'static_map'
  ) {
    $migrations['d7_user_role']['process']['permissions'][0]['map']['masquerade as admin'] = 'masquerade as super user';
  }
}