N
N
nordwind20132018-09-21 17:58:44
ASP.NET
nordwind2013, 2018-09-21 17:58:44

How to implement authorization by roles in MVC?

According to TK, you need to use forms authentication. I have an account entity that has a Role property, it can take 2 values: User, Admin. Authentication implemented by mail and password. For the admin, I want to display a different view with additional functionality. How can such authorization be implemented?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Bashinsky, 2018-09-25
@BashkaMen

Option 1. Separate url
Option 2. Drop-down list of authorization type
Option 3. During initial authorization (login, pass), determine what kind of user (user or admin) and if admin do additional actions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question