#39252 closed defect (bug) (fixed)
Admin Bar shows "Add User" link to users without 'create_users' cap
| Reported by: | dlh | Owned by: | johnbillion |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.8 |
| Component: | Users | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Thanks for the patch, @Soean.
We should add a test for this in the
Tests_AdminBartest class.