Reputation: 9087
Using tastypie, how do I only authorize authors of objects the ability to edit/delete objects they have created? For example, if user 1 created an object A, how can I make it so user 2 cannot edit or delete object A but user 1 can edit or delete object A?
Upvotes: 0
Views: 637
Reputation: 1434
Check this cook-book entry: http://django-tastypie.readthedocs.org/en/latest/cookbook.html#creating-per-user-resources
If that doesn't fit you well, there is an WIP on per-object permissions in the perms branch of tastypie repo. You might want to check that out but beware that it's not ready yet.
Upvotes: 2