Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

Add User endpoint (no user_meta handling) - #128

Closed
tobych wants to merge 10 commits into
WP-API:masterfrom
tobych:users-for-pull-request-without-metadata
Closed

tobych wants to merge 10 commits into
WP-API:masterfrom
tobych:users-for-pull-request-without-metadata

Conversation

@tobych

@tobych tobych commented Apr 8, 2014

Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should handle this too.

@rmccue

rmccue commented Apr 9, 2014

Copy link
Copy Markdown
Member

Phew; tonnes of inline comments above, but fantastic start on this! Thanks so much for what you have so far!

Feel free to ask any questions about anything I've mentioned; you can also email me directly if you'd prefer. :)

@rmccue rmccue added this to the 1.0 milestone Apr 9, 2014
@rmccue rmccue mentioned this pull request Apr 9, 2014
@tobych

tobych commented Apr 10, 2014

Copy link
Copy Markdown
Contributor Author

Thanks for the comments. I'll move things forward, with individual commits. Then when you're ready to pull I can squash them all together into one.

Meanwhile, I'm wondering if there should be a class for each User called API_User or something, that we can work with, and that the API code can automatically render as a dictionary using introspection, before being rendered further as JSON. Tom Christie's (@tomchristie) Django REST Framework is quite gorgeous in this respect and might be worth looking at: http://www.django-rest-framework.org/ I've also noticed that user roles and per-user capabilities are all stuffed into one meta item... that'll be interesting to handle with a RESTful API. Anyway, I digress. I imagine these comments belong elsewhere.

@tobych

tobych commented Apr 12, 2014

Copy link
Copy Markdown
Contributor Author

You can now add a user. More to come, but my six-year-old just woke up.

@tobych

tobych commented Apr 13, 2014

Copy link
Copy Markdown
Contributor Author

I've now done everything @rmccue has suggested, I think, apart from pagination, as explained above.

@tobych

tobych commented Apr 13, 2014

Copy link
Copy Markdown
Contributor Author

@rmccue has pointed out that "current_user_can('edit_user', $id) is called a meta cap. It maps to the correct real permission internally (edit_users/edit_profile or appropriate other permission).". So I'll update that.

Also, make error messages less apologetic. Sorry about that.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants