diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 8b528d3..ceeb61c 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -1450,8 +1450,8 @@ function user_role_names($membersonly = FALSE, $permission = NULL) { * Implements hook_user_role_insert(). */ function user_user_role_insert(RoleInterface $role) { - // Ignore the authenticated and anonymous roles. - if (in_array($role->id(), array(DRUPAL_AUTHENTICATED_RID, DRUPAL_ANONYMOUS_RID))) { + // Ignore the authenticated and anonymous roles or the role is being synced. + if (in_array($role->id(), array(DRUPAL_AUTHENTICATED_RID, DRUPAL_ANONYMOUS_RID)) || $role->isSyncing()) { return; } @@ -1487,8 +1487,8 @@ function user_user_role_insert(RoleInterface $role) { * Implements hook_user_role_delete(). */ function user_user_role_delete(RoleInterface $role) { - // Ignore the authenticated and anonymous roles. - if (in_array($role->id(), array(DRUPAL_AUTHENTICATED_RID, DRUPAL_ANONYMOUS_RID))) { + // Ignore the authenticated and anonymous roles or the role is being synced. + if (in_array($role->id(), array(DRUPAL_AUTHENTICATED_RID, DRUPAL_ANONYMOUS_RID)) || $role->isSyncing()) { return; } diff --git a/core/profiles/standard/config/system.action.user_add_role_action.administrator.yml b/core/profiles/standard/config/system.action.user_add_role_action.administrator.yml new file mode 100644 index 0000000..4a74817 --- /dev/null +++ b/core/profiles/standard/config/system.action.user_add_role_action.administrator.yml @@ -0,0 +1,9 @@ +id: user_add_role_action.administrator +label: 'Add the Administrator role to the selected users' +uuid: d70cd72c-578f-42fc-9a34-5248795b1616 +status: true +langcode: en +type: user +plugin: user_add_role_action +configuration: + rid: administrator diff --git a/core/profiles/standard/config/system.action.user_remove_role_action.administrator.yml b/core/profiles/standard/config/system.action.user_remove_role_action.administrator.yml new file mode 100644 index 0000000..154b15f --- /dev/null +++ b/core/profiles/standard/config/system.action.user_remove_role_action.administrator.yml @@ -0,0 +1,9 @@ +id: user_remove_role_action.administrator +label: 'Remove the Administrator role from the selected users' +uuid: 06df3569-2746-4c9e-8b37-55bb17e44441 +status: true +langcode: en +type: user +plugin: user_remove_role_action +configuration: + rid: administrator