web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Model-driven app secur...
Power Apps
Unanswered

Model-driven app security model for multi level records in relationship

(0) ShareShare
ReportReport
Posted on by 4

I need advice or help regarding the security model for my model-driven app.
As an example, I will use a list of companies, their shops and products.

 

I have 3 tables that have a relationship (Lookup) 1:n:
1. Companies - list of companies and their addresses, etc.

obartonek1_1-1692879502727.png

 

2. Shops - Every company has its own shops over the world

obartonek1_2-1692879577679.png

 

3. Products - a list of products that are in the shop

obartonek1_3-1692879590977.png

 

 

The goal is to share a record with a users or teams, and these users should see all related records in other tables.

obartonek1_5-1692879646627.png

 

So when I share "Company A" with the CEO (in Test Team) of this company, so this CEO should see all records that are in a relationship with this company (Shop A1, Shop A2, Product A11, A22, etc.).

obartonek1_4-1692879628384.png

obartonek1_6-1692879679919.png


Now when I check the access for Shop A1 or A2, I see that the CEO has access to these shops that are in relationship to "Company A".

obartonek1_7-1692879741758.png

 

The problem is when I check access for Products. Here we can see that the CEO has no access to products which are related to Shop A1, A2.

obartonek1_8-1692879768382.png

 

This means that this "shared related records" access is only for "1 level" (Company -> Shop).

 

The question is, if is possible to set/configure "depth" of this sharing somewhere?
Can be this solved in another way?

 

I tried use "Business Units" and Team, but the problem is that I would have to set a BU for each record in all tables, so in my case there may be more than thousands of records. Therefore, I would like to have it it with the this hereditary share.

 

Thanks for any advice.

I have the same question (0)
  • MarioRing Profile Picture
    541 Super User 2024 Season 1 on at

    Hi, 

    The missing piece of the solution you are looking for is called the Parental table relationship behavior

     

    This is the setting of the 1:N relationship between two tables, where you can choose what to do with the "child" records when their parent record is changed. For instance, you can choose to automatically share all the child records automatically when you share their parent: 

     

    MarioRing_0-1692890764638.png

    Go to make.powerapps, navigate to your solution, find your table, navigate to Relationships, find the proper one(s), change "Type of behavior" to "Custom", and set "Share" as "Cascade All". Save all, publish all, and test if it works;)

     

  • obartonek1 Profile Picture
    4 on at

    Hi @MarioRing ,

    Oh... I miss this. I played with that before, but I did not realized that it can affect this sharing function.
    Now it is working as expecting, so thank you so much for help.

    However if I have another table "Components" which is 1:n to Products, so I am not able to change this "Type of behavior" to "Custom", because it is already set for "Shop" (which make sense), so how can I make it that the CEO can see the Components that are assigned to the Products of Comapny A?

     

    obartonek1_5-1692904884694.png

     

    obartonek1_1-1692904316562.png


    obartonek1_2-1692904729620.png

     

    obartonek1_3-1692904736799.png

     

    obartonek1_4-1692904741432.png

     

    Thank you in advance!

  • Devvj Profile Picture
    1,132 Super User 2024 Season 1 on at

    Hi @obartonek1 
    An alternativ to maybe check out is the "new" Matrix based BU model

     

    Record ownership across business units (aka “matrix data access structure”) – it’s here now (dynamics.com)

    Security concepts in Microsoft Dataverse - Power Platform | Microsoft Learn

     

    Basicly what it does is to allow ownership across BUs, so you define on a user level which Security roles he should have on each individual BU, and the BU owns the records instead of the User/Team (via the Owning Business User-field).

    I could be a thing to consider atleast, since it kinda mad for solving complex sharing models such as your.

    -------------------------------------------------------------------------
    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

  • obartonek1 Profile Picture
    4 on at

    Hi @Devvj 

    thanks for your suggestion.

    I already tried use BU, but problem is that "Components" table is managed / generated automatically via importing (Dataflow) from another systems and all records are by default under one BU, so I am not able to manage there BU manually.

    Thats why I wanted to use Sharing.

    Thnaks

  • Linn Zaw Win Profile Picture
    2,996 on at

    @obartonek1 

    Even the "Components" table is managed / generated automatically via importing (Dataflow) from another system, you can automatically assign the record to the same as the Owner of the parent Product using some sort of automation (like Power Automate cloud flow). In that way, the Product and the Component will be in the same BU.

     

    If possible, I recommend revisiting your original "Business Units" and Team solution.

    I prefer to avoid sharing functionality unless it is only shared for very few records because it can cause performance issues in the long run if there are a lot of records being shared.

    https://crmtipoftheday.com/969/the-problem-with-sharing/

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard