Subject: Roles and membership asp.net 2
Posted By: zeeshannasir Post Date: 9/14/2006 4:49:57 AM
hi

i have my whole database and also have tables for user login etc. Now i want to use my tables not the tables generated by aspnet_regsql for roles and membership. its client requirement that i must use tables he has provided me. he has two different tables, one for end users and one for admins. and he dont want it to be changed. Is there any way i can use these tables and implement .net 2 feature of memberships and roles.

please help.

thanks in advance
Reply By: peace95 Reply Date: 9/22/2006 3:34:17 AM
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.

Go to topic 38509

Return to index page 168
Return to index page 167
Return to index page 166
Return to index page 165
Return to index page 164
Return to index page 163
Return to index page 162
Return to index page 161
Return to index page 160
Return to index page 159