bhakti_thakkar
07-07-2009, 01:20 PM
Hi all,
i have a table (Users_Roles_T) where in i assign different roles to a user for e.g user_id 1 has three roles 1,2,5 (Admin , Accounts , Inspector)
Users_Roles_T :
User_ID | ROle_ID | RoleName_VC
1 1 Admin
1 2 Accounts
1 5 Inspector
Now there is another table in which i store all the menus that are applicable for a user
for eg : Menu_T
Menu_ID | MenuName_VC | Roles_ID (storing comma seperated in this field)
1 Sales 1,5,4,2,
2 New projects 5,4,9,3,
3 Registrations 8,12,10
in the above eg Menu Sales and New Projects both are available to user "1" as his combined roles have the respective menus. But Registration Menu is not applicable to user "1" as it doesnt fall in to any roles of this user(1,2,5)
How will i build the query to extract all the MEnu_ID from Menu_T table for a Role
Please help
Thanks
Bhakti
i have a table (Users_Roles_T) where in i assign different roles to a user for e.g user_id 1 has three roles 1,2,5 (Admin , Accounts , Inspector)
Users_Roles_T :
User_ID | ROle_ID | RoleName_VC
1 1 Admin
1 2 Accounts
1 5 Inspector
Now there is another table in which i store all the menus that are applicable for a user
for eg : Menu_T
Menu_ID | MenuName_VC | Roles_ID (storing comma seperated in this field)
1 Sales 1,5,4,2,
2 New projects 5,4,9,3,
3 Registrations 8,12,10
in the above eg Menu Sales and New Projects both are available to user "1" as his combined roles have the respective menus. But Registration Menu is not applicable to user "1" as it doesnt fall in to any roles of this user(1,2,5)
How will i build the query to extract all the MEnu_ID from Menu_T table for a Role
Please help
Thanks
Bhakti