Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#30526 closed defect (bug) (fixed)

Wrong menu structure if user don't have create_users permission

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

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 12 years ago.
Bug screenshot
capture_11272014_132422.png​ (28.7 KB ) - added by Stas Softangible 12 years ago.
Correct screen shot, previous one is wrong
30526.patch​ (1.4 KB ) - added by SergeyBiryukov 12 years ago.

Download all attachments as: .zip

Change History (7)

@Stas Softangible
12 years ago

Correct screen shot, previous one is wrong

#1 @SergeyBiryukov
12 years ago

  • Component Administration → Users

#2 @SergeyBiryukov
12 years ago

  • Keywords has-patch commit added
  • Milestone Awaiting Review → 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
12 years ago

  • Version 4.0.1 → 3.1

#4 @wonderboymusic
12 years ago

  • Owner set to wonderboymusic
  • Resolution → fixed
  • Status new → 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.