0

This appears to have solved the issue. In modules in web config, I added this line...

I am attempting to limit access to a controller class by role:

namespace tvc.Controllers
{
    [Authorize(Roles="Admin")]
    public class productsController : Controller
    {

User management is working in my application. I'm able to create users, assign roles, log in, etc. However, when I add (Roles="Admin") to the [Authorize] attribute, I get the SQL Server error. I'm guessing that MVC is looking for the local database (in app data), but I don't know where I'd change that behavior and this is production and a remote DB is used.

I would like to know why I'm getting this error and how to properly use the role attribute.

tintyethan
  • 1,772
  • 3
  • 20
  • 44

0 Answers0