how to make Roles and manage Users?

274 Views Asked by At

in my Project i need to define 3 roles :

  1. SuperAdmin
  2. Admin
  3. RegisteredMembers

I also have Table which named "Users" that stores information such as:

  1. fristName
  2. lastName
  3. Birthday
  4. Username
  5. Password . . . and etc

How can i make Roles recognize which user is for which Role when users try to log on to website?

1

There are 1 best solutions below

0
On

First of all you creating a Users table is just the first step. You also need a Role table and a UserRole many-to-many relationship table to store which user belongs to which role(In a simple scenario).

That's for the database part of the whole concept.

Then, on the code side...since you're providing different tables than the ones in the AspNetMembership you need to also implement a custom membership provider, custom role provider and presumably a custom membership user.