I'm working on an asp .net mvc 4 application. I have created a database for users and roles (one table for users and one other for their roles). I want to control the access to some pages. Just so you know I have many roles in my table (if there was only two roles this would have been easy to do). How can I do that? Is there any modification I shoud do on web.config? - is it possible to hide a button (for example) for some users (not to hide all the view) or is it obligatory to hide all the view?
Asked
Active
Viewed 1,589 times
0
-
1possible duplicate of [ASP.NET MVC Authorization](http://stackoverflow.com/questions/329658/asp-net-mvc-authorization) – Madara's Ghost Jul 27 '12 at 21:21
1 Answers
0
There are a few questions like this, please see: ASP.NET MVC Authorization
The Authorize attribute is still valid and works well with the UserProvider and RoleProvider. http://msdn.microsoft.com/en-us/library/system.web.mvc.authorizeattribute.aspx