Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#30526 closed defect (bug) (fixed)

Wrong menu structure if user don't have create_users permission

Reported by: stas-softangible's profile Stas Softangible Owned by: wonderboymusic's profile wonderboymusic
Milestone: 4.1 Priority: normal
Severity: normal Version: 3.1
Component: Users Keywords: has-patch commit
Focuses: administration Cc:

Description

I have removed create_users permission from administrator user.
As expected on "All users" panel the button "Add new" disappeared, but on left menu link "Add new" still exists. Clicking on it displayed confusing error "Cheating huh?".

Probable place of the bug:
File: /wp-admin/menu.php
Lines: 195-200

Attachments (3)

capture_11272014_131506.png (28.7 KB) - added by Stas Softangible 9 years ago.
Bug screenshot
capture_11272014_132422.png (28.7 KB) - added by Stas Softangible 9 years ago.
Correct screen shot, previous one is wrong
30526.patch (1.4 KB) - added by SergeyBiryukov 9 years ago.

Download all attachments as: .zip

Change History (7)

@Stas Softangible
9 years ago

Bug screenshot

@Stas Softangible
9 years ago

Correct screen shot, previous one is wrong

#1 @SergeyBiryukov
9 years ago

  • Component changed from Administration to Users

#2 @SergeyBiryukov
9 years ago

  • Keywords has-patch commit added
  • Milestone changed from Awaiting Review to 4.1

Related: [17431] (for #16501).

The promote_users check is wrapped in is_multisite() in user-new.php, but not in menu.php.

#3 @johnbillion
9 years ago

  • Version changed from 4.0.1 to 3.1

#4 @wonderboymusic
9 years ago

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

In 30659:

The menu items for users.php and profile.php that require the promote_users cap should be wrapped in an is_multisite() conditional a la user-new.php.

Props SergeyBiryukov.
Fixes #30526.

Note: See TracTickets for help on using tickets.