Privacy Rules not applied on list of things :count?

Hi Bubblers,

I’ve got a question on Privacy Rules.

So let’s say I have a “playlist”, that has a list of “audio”. The audio is a data type and has field “is reported?”. I have a privacy rule that says, if the audio is reported, noone can view it or search it.

I have a text that displays the count of “audios” in a playlist → “this playlist’s list of audios :count”
I have a “Playlist” with 4 “Audios”, 3 is not reported, and 1 is reported, so that text should show “3 Audios”, however, it keeps showing “4”.

When I change the search of that text to → search for “audios” :filtered playlist contains this audio, only then does it display “3 audios”.

So my questions is, why aren’t privacy rules applied when counting a lists of things? By the way, it works completely fine in a repeating group. The repeating group only displays 3 audios. But even after copying the repeating group’s data source query into that text, it still shows “4 audios”

What is going on?

Your privacy rules might be overlapping each other - happens often when you have user roles.

or

The audio’s privacy rules was not configured properly i.e. you only hid the fields but users can still search it.

Mind if you take a quick screenshot of your audio privacy rules?

I see, but like I said though I get 3 audios if I display them in a repeating group, but I get 4 count when adding :count. Nothing about the search is changed, except for adding :count at the end.

And yes, I was using the app as a non-creator of the audio and non-admin.

In the debugger how many items does your repeating group and it’s data source (click on the data source in the debugger) show?

What exactly is your privacy rule (post a screenshot).

Remember, ‘Find In Searches’ privacy rules apply only to searches… they don’t restrict data being retrieved in other ways (such as via linked fields, including lists).

So my questions is, why aren’t privacy rules applied when counting a lists of things?

When you store a list of things on a datatype, it’s just a list of unique IDs.

There is no further information about the things in that list available (such as whether or not they are Reported) until they’re retrieved from the database (which they can be, as items in lists are not protected by the Find In Searches Privacy rule).

So if there are 4 things in that list, regardless of whether some of those things are hidden from searches with privacy rules, then a count of that list will always be 4.

When I change the search of that text to → search for “audios” :filtered playlist contains this audio, only then does it display “3 audios”.

As I said, unchecking the ‘Find In Searches’ box in a privacy rule prevents the thing being found in a search. So in this case, only the 3 non-reported Audios will be retrieved by the search.

1 Like

Ah I see, so that explains my issue. I really thought that “find in searches” would also apply to fields. I’ve been meaning to use less lists anyways, so I guess I should pull the trigger now.

The debugger says there’s only 3

This topic was automatically closed after 14 days. New replies are no longer allowed.