Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#42564 closed defect (bug) (fixed)

Use `promote_users` for role updates in edit_user()

Reported by: ocean90's profile ocean90 Owned by: ocean90's profile ocean90
Milestone: 5.1 Priority: normal
Severity: normal Version:
Component: Role/Capability Keywords: has-patch
Focuses: Cc:

Description

edit_user() can also update user roles but is still using the edit_users capability instead of the newer promote_users capability introduced in [14176].

We have a similar role handling in https://core.trac.wordpress.org/browser/tags/4.8.3/src/wp-admin/users.php?marks=96-97,121-128#L93 and should copy that to edit_user() for consistency.

  • Change edit_users to promote_users
  • Change manage_site to manage_network_users

Attachments (2)

42564.diff (1.9 KB) - added by ocean90 7 years ago.
Also props to @jjj and @flixos90
42564.2.diff (4.0 KB) - added by ocean90 7 years ago.

Download all attachments as: .zip

Change History (5)

@ocean90
7 years ago

Also props to @jjj and @flixos90

#1 @johnbillion
7 years ago

  • Milestone changed from 4.9.1 to 5.0

@ocean90
7 years ago

#2 @ocean90
7 years ago

  • Owner set to ocean90
  • Resolution set to fixed
  • Status changed from new to closed

In 42855:

Users: Use promote_users for role updates in edit_user().

edit_user() can also update user roles but was still using the edit_users capability instead of the newer promote_users capability introduced in [14176].
This makes the role handling consistent with the bulk dropdown menu for role changes.

Props flixos90, johnjamesjacoby, ocean90.
Fixes #42564.

#3 @johnbillion
6 years ago

  • Milestone changed from 5.0 to 5.1
Note: See TracTickets for help on using tickets.