Base solution for your next web application
Open Closed

How Does a User Change/Switch between Organization Units? #11615


User avatar
0
ayoyusuf created

Prerequisites What is your product version? -> 12.0

What is your product type (Angular or MVC)? -> Angular

What is product framework type (.net framework or .net core)? -> .net Core

We are currently using OrganizationUnits in our App. However, we now have a need for some users to belong to Multiple organization units. In such situations, We are trying to find out what is currently inbuilt into AspZero to enable users to Switch the current OrganizationUnit they are interacting with when logged in as a normal user in a Tenant.

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @ayoyusuf

    If this is a system wide value, you can place an organization unit tree component next to username field on top-right corner and when a OU is selected, you can keep selected value in your session.

    You can check https://aspnetboilerplate.com/Pages/Documents/Articles%5CHow-To%5Cadd-custom-session-field-aspnet-core to add a new field to session.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ayoyusuf created

    Hi @ismcagdas

    Thanks for the prompt response. This is very clear. Thanks.

    However, this sample only shows how to set a value at the initialization of the Session parameter. Kindly advice, how do we update the session value? (I would prefer to use best practice as this might be a sensitive component, so I don't want to just mess around.)

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    In order to update a claim, you need to follow this https://github.com/aspnetzero/aspnet-zero-core/issues/3667#issuecomment-754460339

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)