0

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?

Kira
  • 1,153
  • 4
  • 28
  • 63

1 Answers1

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

Community
  • 1
  • 1
Michael
  • 421
  • 2
  • 10
  • 23