Hi guys
I'm wondering what is the best way to set-up security for the below case.
My business operates in multiple countries. Let's say for example UK, Germany, and France.
In each country there are Clients, assigned to the country (1-to-n, one client belongs to a single country, one country has many clients).
There are multiple other records having 1-to-n relationship with a client (offers, opportunities, comments, etc.)
Then, there are Users, who can belong to one or more countries (n-to-n).
Then, a user needs to have a specific access to each of the records related to clients within the countries the user belongs to, e.g. one can only view clients and nothing else, other can view clients and create offers, other can view and edit everything etc.)
So for example
User A is assigned to France and has got a viewer access for clients and comments, so they can only read clients and comments related to the clients from France)
User B is assigned to UK and Germany and has got creator access for clients and offers, so they can create clients and offers related to the clients from UK and Germany (they should be able to specify which country the client should be assigned to when creating the client)
Initially I thought about using Business Units, each country being a BU, and when a user creates a client, the client is automatically tied to the country (BU) via owning BU. However, this won't work, since a user needs to be able to create clients assigned to various countries, and with BUs the country will always be assigned to the user's default BU.
Any ideas on how to solve this?
PS
I know I can use filters in Power Apps and hide buttons based on currently logged in user's team association, however this doesn't seem like proper security. I would like to achieve this at dataverse level, so that when a user accesses dataverse via power query for example, they still can see only what they should see.