Multiple roles in Controller action
asp.net, asp.net-mvc, asp.net-mvc-4, asp.net-mvc-5, c#
Solution
Yes, like this:
[Authorize(Roles = "admin,userRole")]
Problem
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