Click here to Skip to main content
11,705,119 members (45,474 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET MVC
Please explain what's the difference b/w these 2 statements..
1. [authorize(roles="Admin"]
2. [authorize(users="Admin"]

any help would be appereciated.

Thanks in advance
Posted 31-Jan-13 0:52am
Zoltán Zörgő at 31-Jan-13 9:48am
Everything depend on the Role and Membership provider you use - but in general Fred Flams's answer is correct.

1 solution

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

Solution 1


You have to understand tha a "Role" is kind of like a group of users (as in Active Directory), and that "User" is jus the user as itself.

As an example, you can have a user named "Admin" who is the site administrator, then you have users being granted administrator privileges and in that case their username will be "someone" but they will have the "Admin" role and as such be granted access to the ressource.

I know that can be confusing, but you really have to understand that the diffenrece is being made between a username and a role (or group membership).

Hope my comments will help you.
Marcus Kramer at 31-Jan-13 9:57am

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 595
1 OriginalGriff 289
2 Andy Lanng 175
3 CPallini 162
4 ppolymorphe 126
0 OriginalGriff 8,958
1 Sergey Alexandrovich Kryukov 8,276
2 CPallini 5,189
3 Maciej Los 4,726
4 Mika Wendelius 3,606

Advertise | Privacy | Mobile
Web03 | 2.8.150819.1 | Last Updated 31 Jan 2013
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