简体   繁体   中英

ASP.NET MVC Membership and multiple accounts for the same company

Currently we support one single account per customer. This means that we have a Profile associated with the membership UserID that contains all the company data.

We now need to allow multiple account for single customer. The scenario is the following: the company owner purchases the service: he/she registers using ASP.NET MVC membership and a customer record associated to the UserID is created, then it manually sends invitation to some of his/her employees to register and get access to the company account.

How would you implement this is ASP.NET MVC 4?

Thanks.

Your question is not clear enough, you didn't say about the multiple account for single customer and what is the role of each account(costumer)..

If you mean that you want to make a third user : employee , so you can work width roles see this example:

http://www.codeproject.com/Articles/578374/AplusBeginner-splusTutorialplusonplusCustomplusF

example of creating user with roles :

http://www.codeproject.com/Articles/1075134/ASP-NET-MVC-Security-And-Creating-User-Role and you should authorized each controller or class with this attribute:

for example:

[Authorize(Roles="employee")]

or

[Authorize(Roles="admin")]

this enable you to detect the type of this user ...

And if you want to make multi account for single customer you can work width roles and add a role to each type of customer you want to create..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM