Click here to Skip to main content
Sign Up to vote bad
good
See more: ASP.NETMVC
Hi,
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:52

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

1 solution

Hello,
 
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.
  Permalink  
Comments
Marcus Kramer - 31 Jan '13 - 9:57
+5.

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 414
1 Arun Vasu 253
2 OriginalGriff 200
3 CPallini 163
4 Aarti Meswania 158
0 Sergey Alexandrovich Kryukov 10,169
1 OriginalGriff 7,749
2 CPallini 4,181
3 Rohan Leuva 3,482
4 Maciej Los 3,089


Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 31 Jan 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid