I'm new to ASP.NET MVC 5. In the project I'm developing I have two user tables: one for clients and one for employees. I need to create two distinct login forms: one for clients and one for employees. The clients will have access to a particular part of the website, the employees will have access to another distinct part. Each part has its own actions. How can use the Authorize Attribute in order to distringuish clients from employees?
About creating different login forms, that won't be necessary at all. You can use one login form for both roles but depending on what you want either to see when logged in, you make use of User.IsInRole
to verify and maybe redirect them or some other course action of your choice.
This is of course in addition to the answer provided by "The Akhemist".
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments