appdotnet / api-spec

App.net API Documentation is on the web at https://developers.app.net. Source for these docs is in the new-docs branch here. Please use the issue tracker and submit pull requests! Help us build the real-time social service where users and developers come first, not advertisers.
https://developers.app.net
950 stars 98 forks source link

No way to tell if a post can be deleted #132

Closed beccadax closed 12 years ago

beccadax commented 12 years ago

There's no direct way to check if a post can be deleted by the current user. You can compare the user ID in the post to a pre-fetched user ID for the user, but that requires two API calls, and will break if the rules ever change (for example, if there are ever group/company accounts that several different users can post to). It'd be nice if each post had a can_delete field or similar explicitly indicating that the current user can delete that post.

mthurman commented 12 years ago

I think in this case it's reasonable to either assume that the user id for the "current user" is stored with the access token so you already know who the current user is. And since the rules for deleting posts is very simple right now (post.user_id == current_user.id) I don't think this flag is needed in the core API right now. If we ever do get more complex situations as you mention, that will probably be part of a larger API update (v1, v2, etc) and we can revisit this then.