I've got a custom role called 'Gym' and custom post type (CPT) called 'Story'. Every Gym user can create a draft of a story and view their own story drafts.

My 'Story' CPT have got the following capabilities:

[cap] => stdClass Object(
            [edit_post] => edit_post
            [read_post] => read_post
            [delete_post] => delete_post
            [edit_posts] => edit_posts
            [edit_others_posts] => edit_others_posts
            [publish_posts] => publish_posts
            [read_private_posts] => read_private_stories
            [read] => read
            [delete_posts] => delete_posts
            [delete_private_posts] => delete_private_posts
            [delete_published_posts] => delete_published_posts
            [delete_others_posts] => delete_others_posts
            [edit_private_posts] => edit_private_posts
            [edit_published_posts] => edit_published_posts
            [create_posts] => edit_gymtopia_story

A Gym user have the following capabilities:

[read] => 1
[upload_files] => 1
[edit_gymtopia_story] => 1
[read_private_stories] => 1

A Gym user can create a Story draft ok. However, the Gym user is unable to view his own story draft posts. I'd thought that [read_private_posts] => read_private_stories capability would work.. Instead I'm getting 404 page not found.

I would really appreciate any tips and help, I don't know what I'm missing.

Many thanks, Dasha

  • The user needs edit_posts to see drafts. Have you assgned that cap too?
    – fuxia
    Apr 22, 2013 at 14:04
  • @toscho, to confirm, does a Gym user needs both capabilities: edit_posts and read_private_stories? I find Codex page of capabilities a bit hard to read and understand completely :(
    – dashaluna
    Apr 22, 2013 at 16:03
  • private is similar to publish. This status is always a source of confusion. :) See this example for manually assigned custom capability and access restrictions.
    – fuxia
    Apr 22, 2013 at 16:10


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.