[wp-trac] [WordPress Trac] #14122: Custom "capabilities" appears broken on custom post types
WordPress Trac
wp-trac at lists.automattic.com
Mon Jun 28 03:00:49 UTC 2010
#14122: Custom "capabilities" appears broken on custom post types
--------------------------+-------------------------------------------------
Reporter: jakemgold | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Post Types | Version: 3.0
Severity: major | Keywords: 2nd-opinion
--------------------------+-------------------------------------------------
Comment(by jakemgold):
"I imagine the errors are due to edit_post being the capability, which
then goes through map_meta_cap and maybe it determines you need edit_posts
(instead of edit_movies)?"
No. Even if you change the code above to use a completely custom
"capability_type" (rather than defining granular capabilities) like
"movie" (which gets "edit_movie", "edit_movies" etc) this same behavior
persists.
Same ability to access Add New screen, same errors in editor and upon
saving. Even more strange, assigning "edit_movie" (singular) to "producer"
(in example) as a primitive capability will allow the user to successfully
save the post, but the editor error still persists. It will also, of
course, allow the producer to edit other users posts (despite lacking that
capability), but this is to be expected, I suppose, since it's supposed to
be a meta capability.
We can debate the definition of a "bug" - it may not be broken / crashing
code, but I think it's broken from the perspective of "expected" API
behavior for developers. But it seems to me that mapping meta capabilities
should be "auto-magic" for custom post types, especially public ones.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14122#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list