how to assign roles to users in Database ?
mean i have admin, applicant ? so how could i differentiate bw them ?
HELP !!!

Recommended Answers

I am still not clear on what you are asking but have you taken a look at some of the information on Microsoft MSDN?

Database Level Roles:
http://msdn.microsoft.com/en-us/library/ms189121.aspx

Create a Login:

Jump to Post

All 11 Replies

First, what is the database platform? MSSQL, MySQL, etc?

Hello akkbkht,

From what i understand, you can do this by having, for example, a MEMBER_ROLE table e.g

roleID | roleName | Description
  1      Admin      Administrator
  2      Applicant  bla bla bla

and ofcourse, you have a member table..

memberID | firstName | lastName | roleID(fk)
 1         Beautiful    You         2
 2         akkbkht      Daniweber   1

Then you could write your queries to suit this...e.g
check this member with memberid 2, is he an admin? if yes, allow access somewhere, else, deny.
Hope this helps you.

Regards,
Seslie

ahaaan !!! Thanks alot dear users !!! its clear to me now !!!
@Seslie

one more thing , on front end i have two SignUps, 1 for applicant and one for sub-Admin of different hotels !!!
store procedure will directly assign ID=1 (Role) for applicant but what i should do for admin ? mean he/she would have to wait for that (mean role have to be assigned by Su?per Admin) ? or what ?

one more thing , on front end i have two SignUps, 1 for applicant and one for sub-Admin of different hotels !!!
store procedure will directly assign ID=1 (Role) for applicant but what i should do for admin ? mean he/she would have to wait for that (mean role have to be assigned by Su?per Admin) ? or what ?

@Hunain I think u got your answer now....

@seslie. Thanks alot. That's it. You have solved my issue. Once again thanks a lot for all your help.

Glad I could help. You're very welcome.