views:

6

answers:

0

What would be the best practices to design a membership based system.

Say you have 3 different kinds of membership (Free, Pro, Unlimited) Each of these memberships allow different levels of access within the system.

eg:This list is variable and can change overtime as new features are added to the system.

Free: Can store 2 Photos,Has access to 5 photo effects,Cannot save session,...

Pro: Can store 100 Photos,Has access to 50 photo effects,Can save session 10 times,...

Unlimited: Can store Unlimited Photos,Has access to All the photo effects,Unlimited Save sessions,...

Here's my solution

Database design

MembershipType:[Free,Pro,Unlimited]
AccessRights:[Photo Storage Limit,Session Save Limit,No of photo effects,...]
MembershipType_AccessRights:[MembershipType, AccessRight, Value]
User: [Username,...,MembershipType]

Business Logic: When the user logs in, you authenticate and load the access rights based on the membership type ONCE. Every time user performs an action you check against the loaded access rights for that user/session.

What are the pitfalls? Do you have any other suggestions? Are there any best practices to achieve this?

related questions