Skip to content
This repository has been archived by the owner. It is now read-only.

Revisions endpoint not working #164

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

Revisions endpoint not working #164

tlovett1 opened this issue May 3, 2014 · 4 comments
Labels
Milestone

Comments

@tlovett1
Copy link
Member

@tlovett1 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
Copy link
Member

@rachelbaker 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
Copy link
Member Author

@tlovett1 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
Copy link
Member

@rmccue 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
Copy link
Member Author

@tlovett1 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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.