[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 01:44:28 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:
-----------------------------------------+-----------------------
Changes (by dd32):

 * keywords:  has-unit-tests dev-feedback close => has-unit-tests dev-
               feedback
 * owner:   => dd32
 * status:  new => accepted
 * milestone:  Awaiting Review => 5.0


Comment:

 Replying to [comment:11 knutsp]:
 > Explicitly setting a capability to false (denied) should take
 precedence, even over later added roles or explicit capabilities, since
 this is a special and more rare case. The lack of a capability is normal
 way of not giving that capability.

 I agree with this, lets make this happen.

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


More information about the wp-trac mailing list