[wp-trac] [WordPress Trac] #22415: media-upload.php should check whether current user can edit a particular post type

WordPress Trac noreply at wordpress.org
Wed Nov 21 16:10:52 UTC 2012


#22415: media-upload.php should check whether current user can edit a particular
post type
-------------------------------+------------------------------
 Reporter:  danielbachhuber    |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Role/Capability    |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |
-------------------------------+------------------------------

Comment (by westi):

 Replying to [comment:3 nacin]:
 > It would make more sense to leverage map_meta_cap in the plugin, since
 that's how we control permissions for authors.
 >
 > If this code ran through map_meta_cap(), everything should work just
 fine. user_has_cap is a fairly powerful hook as well, but when you're
 dealing with meta caps, you really need to go through map_meta_cap for the
 bulk of it.
 >
 > In short, I don't see a bug here. For some unit tests on how edit_post
 and $post_type->cap->edit_post are the same, see http://unit-
 tests.trac.wordpress.org/browser/trunk/tests/user/mapMetaCap.php.

 +1

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22415#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list