开发者

Restrict users from using admin section in asp.net mvc

开发者 https://www.devze.com 2023-03-21 03:02 出处:网络
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] f

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")]
0

精彩评论

暂无评论...
验证码 换一张
取 消