[wp-trac] [WordPress Trac] #42332: delete_site permission is not working as it should
WordPress Trac
noreply at wordpress.org
Thu Oct 26 13:43:04 UTC 2017
#42332: delete_site permission is not working as it should
-------------------------------+------------------------------
Reporter: Shebo | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone: Awaiting Review
Component: Role/Capability | Version: 4.2
Severity: minor | Resolution: worksforme
Keywords: reporter-feedback | Focuses: multisite
-------------------------------+------------------------------
Changes (by Shebo):
* status: new => closed
* resolution: => worksforme
* severity: normal => minor
Comment:
Thanks for the quick response, @johnbillion.
I saw that `delete_site` was not the only permission that uses that sort
of "meta capability" logic, and I must say it's kind of a weird behavior.
I didn't see any reference to it in the codex or other documentation, and
my assertion was that if I'm explicitly giving some role a certain
capability, it should work without any supplements of support on my
behalf.
I can't think of a use case when someone gives a `delete_site` capability
to certain role and doesn't expect that role to have it.
But I guess that's how the permission system works, and of course - your
solution of using the `map_meta_cap` filter worked like a charm.
Thank you very much for explaining that logic and providing a valid
solution.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42332#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list