Restrict users from using admin section in asp.net mvc
I am using membership in asp.net mvc 2 and i want to restrict users from using the admin section , Currently all the users can access the admin section by using their credentials, I used [Authorise] for all the http get and post request for that , but how can restrict everyone apart from admin & some users with certain privileges , I have got table in db asp_ne开发者_Python百科t Roles which have 2 role names : Admin and user.
You can do this ...
[Authorize(Roles = "Admin")]
精彩评论