[SOLVED] How to make user only view their own data (not everyone else's)

My Users need to see their own saved customers but not other users’ customers.

I have a RG which does a search for Customer with the constraint “Created by = Current User” but it still shows all customers to all users?

See my DB with two Users who each have one saved customer, the trouble is, when I log in as either user and view ‘My Customers’ I see both customers?


Hmmm, this should work fine.

Are you sure you’re logged in? Or maybe you have set something up in the Privacy Rules that overrides this?

1 Like

To complement @oliviercoolen’s response, you have two conditionals on the repeating group. Any chance one of those is changing the data source?

Best…
Mike

1 Like

Thanks guys, I had the privacy rules set on the User but none were set on Customer (whoops!). Anyway, I have set some privacy rules on Customer (below) but now both Users see the same single customer? I have never used privacy settings before so am probably making a rookie error somewhere.


s

Even without the privacy rule on the Customer data type (I’m not saying you shouldn’t have it, by the way, and it looks correct, assuming the boxes you cut off under everyone else are unchecked), the constraint you have on the repeating group’s search should have worked. Are you sure it’s not the conditionals on the repeating group?

2 Likes

Ah, yes you are correct. The conditionals are simply to filter the results so I didn’t think they were the cause but of course they also need to filter for “Created by = Current User” .

There is still something strange happening, I saved 3 fake customers for each User in the DB, but one of the users only sees 1 of their customers! I had to rush this test as busy but I will check this later when I can focus 100%.

Thank you for your help!

1 Like

Upon retesting, all seems ok now. I think my previous anomaly may have been something in my cache. I’m not sure but all fixed now that the conditionals also filter for “Created by = Current User

1 Like