Tuesday, July 3, 2018

ASP.NET Core MVC help with linked accounts using Identity

Hello Redditers, Im a beginner in ASP.NET Core MVC and Im trying to create a web application that uses the Microsoft Identity functionality, I managed to implement user registration and login functionality that stores users and roles to a SQL Database, but I need to make a system of privileges for the users and have it follow a certain hierarchy,

for example,

https://imgur.com/a/5GyUzri

Now I managed to distinguish admin users from employee users by creating roles for each, the registration page registers users with the "admin" role, then the admin account can access a controller that allows him to create users for employees with a "employee" role.

now my problem is that I'm not sure what is the best practice for multiple admin accounts, it is important for an admin user to manage only the employee accounts that he created, the first idea I had was to set the name of the employee role based on the name of the admin account,

so if an admin user is called "X" his role name will be set to "Admin_X" and added to a group of admins for example, and then all the users that he creates will have their role name set to "Employee_X".

this doesn't seem very practical to me, is there any other way to achieve this that I'm not aware of ?

Thank you :)

ASP.NET Core MVC help with linked accounts using Identity Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team