Closed beccadax closed 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.
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.