[wp-trac] [WordPress Trac] #42332: delete_site permission is not working as it should
WordPress Trac
noreply at wordpress.org
Wed Oct 25 12:40:04 UTC 2017
#42332: delete_site permission is not working as it should
-----------------------------+-----------------------------
Reporter: Shebo | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Role/Capability | Version: trunk
Severity: normal | Keywords:
Focuses: multisite |
-----------------------------+-----------------------------
in changeset:31673 the `delete_site` action got it's own capability, but
from what I tested it's not working.
When the function `map_meta_cap` in `capabilities.php` stumbling upon
`delete_site` capability it registers it as `manage_option`.
That means that the condition `if(current_user_can( 'delete_site' ))` will
always be falsey, because there's not scenario when `map_meta_cap` is
producing it.
The current (unwanted) behavior is when `delete_site` explicitly is given
beyond the scope of the `administrator` role, the option is not shown in
the admin menu, and when using the direct url `ms-delete-site.php` a
permission error is shown.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42332>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list