View Single Post
  #2 (permalink)  
Old September 22nd, 2006, 03:34 AM
peace95 peace95 is offline
Friend of Wrox
Points: 793, Level: 10
Points: 793, Level: 10 Points: 793, Level: 10 Points: 793, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: May 2005
Location: OKC, OK, USA.
Posts: 227
Thanks: 1
Thanked 7 Times in 7 Posts

zeeshannasir: It is not clear as to what level the two tables will be applied, however I am responding from the Point Of View (POV) of the application level. In your database, create a RoleTbl, defines all the possible Roles:
RoleID RoleDescription
1 Role A
2 Role B
3 Role C
Another helpful table, if it does not exist already is an Application Table:
AppID ApplicationDesc
1 App 1
2 App 2
Now you can create the relationships, 1) Identify the Admin in each Application:
AdminAppID AdminID AppID
1 1 1
2 1 2
3 2 3
Next you would create a EndUserRoleTable By Application. This will be one of your largest table because it allows for your end users to have access to different and multiple applications and roles maybe.
1 EU1 1 1
2 EU1 1 2
3 EU2 2 1
One constraint that should be considered here is if the Admin is also an End User. I would think that "Admin" is a type of Role. Just a thought.

Hope this helps.