views:

232

answers:

2

Hello, lets say I got multiple users. They all have items linked to their account. They can CRUD those items.

So now my question is: what's the best way to prevent users from manipulating items from eachother.

At first I thought the antiforgerytoken would help. But it doesn't because when the users look at their control panel they got a valid token. So they could just open firebug and do some post requests to delete items.

While writing this I think I know what I should do. I guess I should just check on the server if the user is deleting his items.

I'll post this question anyway to see if I didn't forget anything which would still make it possible to adjust eachother's items

+1  A: 

The only way to be sure is to check on the server that the current user has permission to "do action"

sirrocco
A: 

You can use the "Roles" mechanizm (this feature ships with asp.net) to check whether a user can delete other accounts.

yosig81
he was asking if it's enough to do the validation on the client side.
sirrocco
The way i solved it was by adding an extra parameter to my delete function. So now it takes Id and User. So when i query for the object to be deleted it returns nothing if the item has a different user.
Pickels