Using the ASP.NET membership provider database with your own database?

Posted by Shaharyar on Stack Overflow See other posts from Stack Overflow or by Shaharyar
Published on 2010-03-10T15:18:49Z Indexed on 2010/03/23 8:33 UTC
Read the original article Hit count: 356

Hello everybody,

We are developing an ASP.NET MVC Application that currently uses it's own databse ApplicationData for the domain models and another one Membership for the user management / membership provider.

We do access restrictions using data-annotations in our controllers.

[Authorize(Roles = "administrators, managers")]

This worked great for simple use cases.


As we are scaling our application our customer wants to restrict specific users to access specific areas of our ApplicationData database.

Each of our products contains a foreign key referring to the region the product was assembled in.

A user story would be:

  • Users in the role NewYorkManagers should only be able to edit / see products that are assembled in New York.

We created a placeholder table UserRightsRegions that contains the UserId and the RegionId.

How can I link both the ApplicationData and the Membership databases in order to work properly / having cross-database-key-references? (Is something like this even possible?)

All help is more than appreciated!

© Stack Overflow or respective owner

Related posts about c#

Related posts about c#3.0