views:

55

answers:

3

Hello, I have an application where users can store items. Now each type of account can store a limited amount of items. For example basic account can store 25 items, premium can store 50 and max can store unlimited items.

Now my question is what would be the best approach to do this?

At first I was thinking of just making different roles for each "account type" but I guess that's not very flexible. I guess the other option is to make a profile property that has the max number of items an account can have. But maybe the profile property has some other limitations I don't see at the moment?

Any input on this is greatly appreciated.

A: 

I have ran across this once before. How I handled it was I have a profile property account that gives a default max number to that profile based on its account type role. That way you get the best of both worlds.

Aaron
A: 

I would use the inbuilt aspnet Roles functionality. There are good articles about this throughout the interweb, though this series by 4 guys from rolla may be a good starter.

Robert W
Thanks for the answer but you might have missed my question there. My question is about if I should use profile properties or roles for my scenario.
Pickels
+1  A: 

I would go outside of the built in profile tables. You could always make a table called ItemStoreLog which has a uniqueidentifer userid which matches up with your aspnet_user userId and another column which holds the item storage allocation. Then as your user changes (+/- items) you just update this table with the amount of items to store.

Chris