Search code examples
azureazure-active-directoryrbac

Azure Active Directory - Role based Store Manager


I need to implement the store based access to web portal. For that we have created the following roles

  • Admin
  • Store Manager1
  • Store Manager2

I am able to implement authorization for Store Manger 1, Store Manager 2. If there are around 500 stores do I need to add 500 roles in active directory since each role has different view?


Solution

  • It sounds like quite a lot of work to make roles for each store. Though you could automate it with PowerShell, to me it seems a bit weird.

    You could instead just have a Store Manager role, and then on your app side check which stores they access to. One way would be a relational table with one column being the user's id and the other a store id they have access to. You can query that when you authenticate the user and store the values in claims/session data.