login with different users

Posted by Suneel161 under Regular Expressions on 1/6/2011 | Points: 10 | Views : 1498 | Status : [Member] | Replies : 3
I have 3 different users admin,agent,master
I have a menu but admin can view full menu and agent can view only few and master can view few of them. here i am binding menu dynamically using datalist .
How to do please help me.




Responses

Posted by: T.saravanan on: 1/6/2011 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi Suneel161,

Maintain a Menu Id's in your user detail tables.For example assign one column for Menu Id's, in this column have the menu id's based on the user level.
When will you login, based on the User Id to show the Menu.

For ex:


User Detail Table:
User_ID User_Name Menu_Id

1 A 1,2,3,4
2 B 1,3
3 C 2,4

Menu Detail Table :
Menu_ID Menu_Name

1 Menu 1
2 Menu 2
3 Menu 3
4 Menu 4





Thanks,
T.Saravanan

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Suresh.mekkattil on: 1/9/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi,

The basic thing is to hide the menu item from the view.

It is better to store all the menu items in the database and load all of them when needed.
After that, you can using the Role Checking System, which you might created, and check for the user accessibility of a perticular menu item.

Thus you can hide the menu item from the user view.

If you store menudetails of the each users in the DB, you need to maintain hte DB in detail. By using above mentioned method, you dont need to bother about the DB part because you are storing all the menus as a master data.

Hope you got my point!!

-----
Suresh M

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 1/9/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi,

You can main 3 tables for that.... one is a tMenu, tMenu details and tRoles also u need one more table to maintain the tRolemenumap

the same requirement was into my prev project as well and we followed this process and it was very easy to maintain the same.

tMenu - will have menu names and see if its parent menu or a sub menu
tMenudetails - will have the other links, created and usage details
tRole - will have the role details like admin, user, etc
tRoleMenuMap - Used to keep the mapping details like for which menu which role shld come

let me know in case of any information required.

Thanks
Karthik
www.f5Debug.net

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response