4

i try to create custom role provider in mvc4 to give user access in my site. when i try to using role provider is success.

i success create role provider like this

[Authorize(Roles = "admin")]

my question is, can i use more then one role name in controller? i mean like.

[Authorize(Roles = "admin")]
[Authorize(Roles = "admin")]

try to use this code, but not working for me. any one can show me how does it work? thanks

hutchonoid
  • 32,982
  • 15
  • 99
  • 104
novian kristianto
  • 751
  • 3
  • 12
  • 34

1 Answers1

12

Yes, like this:

[Authorize(Roles = "admin,userRole")]
hutchonoid
  • 32,982
  • 15
  • 99
  • 104