Click here to Skip to main content
12,349,911 members (22,789 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET MVC3
hi,friends.
i am new in mvc3.
I have 3 tables for role model:
1)user_master(user_id,username,password);
2)role_master
(role_id,role_name);
3)role_to_user
(role_id,user_id);

and I want to apply one user to multiple role like user id =1 and given role 1.taskcreate, 2.taskupdate, 3.create company account how can i perform User.IsInRole() condition with this roles.

thank you.
Posted 1-Apr-12 18:14pm
Edited 14-Apr-12 1:20am
v4
Comments
Peace ON 2-Apr-12 2:45am
   
<pre> tag is not required for your question.

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

You can do it easily.

Just assign multiple roles to one user in role_group_master table.

role_group_id role_id user_id
1 10 52
2 22 52
3 33 52


Hope this help!
  Permalink  
Comments
member60 14-Apr-12 7:54am
   
my 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160621.1 | Last Updated 14 Apr 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100