Forum Academy Marketplace Showcase Pricing Features

Privacy Rules Restricting Repeating Group Data

Hi,

So I am having some issues with displaying data in a RG from a “list of numbers” which is stored in a User class.

I have some different users and they have differing amounts of order ID’s stored in a list. I have done it like this, so I can just call the data from the “order thing” class based on the order ID each user may or may not have.

Basically, when I have the privacy rule to only allow each user to access their own data, bubble will only print the first Order ID in the RG and wont do the second. When I delete it, it can, but it also prints everyones data which is not what I want.

This is the code.

This is it with the rule on. You can see if I ask for Item 2 it actually prints it, but it doesn’t actual make another cell in the RG

This is without the rule.


I am fairly certain it has something to do with “current index” of the RG, because it works when I just type the number in.
Any help would be greatly appeciated!

What’s your privacy rule look like?

Also kind of unusual to be storing Order IDs in lists of numbers, normally people just add a user field to Order datatype and store the assigned user to the order itself directly. A search for orders would be Do a search for Orders and you privacy rule would be Order’s Assigned User = Current User


Okay, thankyou for the tip. I can try swapping it around. Also here is the privacy rules

Yea because normally you would be doing privacy rules on the Order data type to control what orders the User sees. Do the users make their own orders or do they get “assigned” to them?

The reason I ask if if they make them all themselves then you can just make the privacy rule “This Order’s Creator is Current User” and it takes care of the whole problem.

They make their own order data. They fill out a form effectively.

Okay try just doing “This Order’s Creator is Current User” on the order data type privacy rule, and you don’t need the Order ID field under the user at all. And your repeating group can just be Do a search for Orders and the privacy rules should limit to just their own.

1 Like

Okay that all makes sense. I’ll try rearrange it all now to work like that and let you know how it goes. Cheers

Thankyou very much. I need to look into using Privacy rules more, I am used to Object Orientated Programming and making the relationships myself.

1 Like

Yea since Bubble automatically creates the “Created by” field it’s making the relationship on the fly. If you needed to “reassign” orders to other users then you would need to create some kind of new User field and adjust the privacy rules to that instead.