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:
RoleTbl
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:
AdminAppTbl
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.
EndUserRoleTbl
EURID EndUserID RoleID AppID
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.
|