[wp-trac] [WordPress Trac] #36376: current_user_can/has_cap fails when user has multiple roles

WordPress Trac noreply at wordpress.org
Tue Dec 5 10:53:49 UTC 2017


#36376: current_user_can/has_cap fails when user has multiple roles
-----------------------------------------+-----------------------
 Reporter:  mikejolley                   |       Owner:  dd32
     Type:  defect (bug)                 |      Status:  accepted
 Priority:  normal                       |   Milestone:  5.0
Component:  Role/Capability              |     Version:
 Severity:  normal                       |  Resolution:
 Keywords:  has-unit-tests dev-feedback  |     Focuses:
-----------------------------------------+-----------------------

Comment (by knutsp):

 Replying to [comment:13 dd32]:
 >  - `John` is given the role of `editor`, a role of
 `denied_publish_capabilities`, but then allowed to publish through
 `publish_posts => true`. Should John be able to post? IMHO: Yes.

 In such cases, `denied_publish_capabilities` must be removed before
 `publish_posts => true` can have effect. That will be consistent and
 easier to document than having exceptions that is hard to grasp.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36376#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list