New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisions endpoint not working #164

Closed
tlovett1 opened this Issue May 3, 2014 · 4 comments

Comments

Projects
None yet
3 participants
@tlovett1
Member

tlovett1 commented May 3, 2014

I have a post with 3 revisions. This GET request returns the information about the post:
http://local.trunk.dev/wp-json/posts/3184

This GET request outputs simply "null":
http://local.trunk.dev/wp-json/posts/3184/revisions

tlovett1 added a commit to tlovett1/WP-API that referenced this issue May 4, 2014

@rachelbaker

This comment has been minimized.

Show comment
Hide comment
@rachelbaker

rachelbaker May 4, 2014

Member

@tlovett1 Thank you for building out this endpoint method. I think we should check the user has permission to read the post before deciding to return the results here.

Member

rachelbaker commented May 4, 2014

@tlovett1 Thank you for building out this endpoint method. I think we should check the user has permission to read the post before deciding to return the results here.

@rachelbaker rachelbaker added this to the 1.0 milestone May 4, 2014

@tlovett1

This comment has been minimized.

Show comment
Hide comment
@tlovett1

tlovett1 May 4, 2014

Member

The prepare_post() method calls check_read_permission() for the given post type. Although on the topic of privacy, I feel like the current user should need the post_type->edit_post cap to be able to view the revisions for that post. What do you think?

Member

tlovett1 commented May 4, 2014

The prepare_post() method calls check_read_permission() for the given post type. Although on the topic of privacy, I feel like the current user should need the post_type->edit_post cap to be able to view the revisions for that post. What do you think?

@rmccue

This comment has been minimized.

Show comment
Hide comment
@rmccue

rmccue May 4, 2014

Member

The prepare_post() method calls check_read_permission() for the given post type. Although on the topic of privacy, I feel like the current user should need the post_type->edit_post cap to be able to view the revisions for that post. What do you think?

The edit cap for revisions is edit_post, and map_meta_cap internally checks against the parent post for revisions, so we should be good here. :)

Can you pull-request this one up please? :)

Member

rmccue commented May 4, 2014

The prepare_post() method calls check_read_permission() for the given post type. Although on the topic of privacy, I feel like the current user should need the post_type->edit_post cap to be able to view the revisions for that post. What do you think?

The edit cap for revisions is edit_post, and map_meta_cap internally checks against the parent post for revisions, so we should be good here. :)

Can you pull-request this one up please? :)

@tlovett1

This comment has been minimized.

Show comment
Hide comment
@tlovett1

tlovett1 May 4, 2014

Member

Pull request sent. prepare_post() is checking the read cap not the edit cap though.

Member

tlovett1 commented May 4, 2014

Pull request sent. prepare_post() is checking the read cap not the edit cap though.

@rmccue rmccue closed this in #193 May 12, 2014

kellbot pushed a commit to kellbot/WP-API that referenced this issue Aug 1, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment