[wp-trac] [WordPress Trac] #12691: Editing a page or custom post type requires edit_posts capability

WordPress Trac wp-trac at lists.automattic.com
Wed Mar 24 20:47:40 UTC 2010


#12691: Editing a page or custom post type requires edit_posts capability
--------------------------+-------------------------------------------------
 Reporter:  rovo89        |       Owner:            
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  Post Types    |     Version:  3.0       
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
 In r13810 (WP 3.0-alpha), it is not possible to create a role which gives
 users only the capability to edit pages or custom post types, without also
 assigning the edit_posts capability.

 To reproduce, create a role with all *_page(s) capabilities plus read, but
 without edit_posts (I used the "Members" plugin for that). Then create a
 user with this role and log in. The menu items for editing and adding new
 pages will be shown, but clicking "Edit" fails with "Cheatin' uh?".

 Similarly, you can also create a new post type with a custom
 "capability_type". Even if you create all the capabilities and add them to
 the role, only the menu title will show up, while "Edit" and "Add new" are
 missing. Trying to call the edit page directly produces the same results
 as above.

 The patch fixes these two bugs by checking for
 $post_type_object->edit_type_cap instead of edit_posts.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12691>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list