Order with multiple items from multiple sellers

0
In our applicaiton it's possible to order items from multiple suppliers. The buyer can only see their own orders by xPath. I want to create the same for the suppliers.  The suppliers can only see the orders where they are participating in, with 1 or more items. When they open the order they only can see the items that are ordered from them. Is there anyway to solve this in an easy way? This is our domainmodel; Thanks in advance.
asked
1 answers
1

You can achieve that with Access Rules. But first simplify your domain model

if wenslijst_tussentabel, leverancier_product_tussentabel and bestelling_heeft_producten have no attributes they can be replaced with a reference set association

 

Add an Bestelregel entity with at least amount and unit

 

After that add an access rule to bestelling

for the Role Supplier

[Bestelregel/Bestelregel_Product/Product/Product_Leverancier/Leverancier/Leverancier_Account='[%CurrentUser%]']

This means that only accounts related to levancier can see the lines of the order which they supply.

 

Make a rule for a client/klant that they can only see their orders/bestellingen.

 

My answer is quite short, please read the documentation about access rules.

answered