Base solution for your next web application
Open Closed

Role User Extesion #10434


User avatar
0
andmattia created

Hi

I try to find a best way to implement this pattern. User Role + Data Segregation.

Suppose to have an entity invoice with IMustHaveCompany and Company entity.

My Goal is to create an access level for user to have specific function on single company

USER_A -> Admin Company 1 USER_B -> User Company 1

USER_A -> User Company_2 USER_B -> Admin Company_2

but if you ad another level like sales organization

| Company A |--| Sales Org 1 |--| Sales Org 2 | Company B |--| Sales Org 3 |--| Sales Org 4

we have more complex situation

  1. User 1 -> Admin Company A, implicty is Admin on Sales Org 1 and 2
  2. User 2 -> Admin Sales Org 1 and User In Sales Org 2
  3. User 3 -> Admin Sales Org 2 and User In Sales Org 1
  4. ....

How is the best way to implement this pattern?

The actual sales organization implementation is not able to do that. If I set my entity with OuOrganizationId (0001.0001 and roles) I cann't assinge a user role in organization unit....


2 Answer(s)
  • User Avatar
    0
    andmattia created

    I found an intresting article https://www.thereformedprogrammer.net/a-better-way-to-handle-authorization-in-asp-net-core/

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @andmattia

    Did you find a solution for this case ?