Click here to Skip to main content
11,479,841 members (48,544 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET MVC3
i am new in mvc3.
I have 3 tables for role model:

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 19:14pm
Edited 14-Apr-12 2:20am
Peace ON at 2-Apr-12 2:45am
<pre> tag is not required for your question.

1 solution

Rate this: bad
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!
member60 at 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
0 OriginalGriff 235
1 Sergey Alexandrovich Kryukov 215
2 F-ES Sitecore 155
3 Richard MacCutchan 100
4 DamithSL 65
0 Sergey Alexandrovich Kryukov 7,890
1 OriginalGriff 7,556
2 Sascha Lefèvre 3,064
3 Maciej Los 2,491
4 Richard Deeming 2,335

Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 14 Apr 2012
Copyright © CodeProject, 1999-2015
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