#39252 closed defect (bug) (fixed)
Admin Bar shows "Add User" link to users without 'create_users' cap
Reported by: | dlh | Owned by: | johnbillion |
---|---|---|---|
Milestone: | 4.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Users | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
On a single-site install, a user needs the create_users
capability to add a user, but the "User" link still appears in the Admin Bar's "New" menu for users with promote_users
. (The user is blocked from adding a user if they visit the link.)
At a glance, it looks like a similar issue was fixed in #30526, and the attached patch would take the same approach by checking is_multisite()
along with current_user_can( 'promote_users' )
before adding the link.
Attachments (2)
Change History (7)
Note: See
TracTickets for help on using
tickets.
Thanks for the patch, @Soean.
We should add a test for this in the
Tests_AdminBar
test class.