I have three relevant DataTypes: User, Team and Contract.
I’m trying set the Privacy Data Roles for the Contract DataType so that a particular Contract is only visible to a User who is a member of a Team associated with that Contract (for example, Jane is in the HR Team, the HR team can see “Tom’s Employment Contract”, so Jane can see that Contract) .
I’m having trouble because it doesn’t seem possible in the Privacy Data Roles’ “When” setting to test whether the Current User’s Team (list - e.g. “HR, Finance”) intersects with the Contract’s Team (list - e.g. “HR”). It only seems possible to see if one list contains a particular item:
Same for a query such as Do a Search For, we can only check if an element IS IN a list, or if a list CONTAINS one single element. It’s a limit of Bubble right now.
The solution is to save before the search if your LIST intersect with the other List : first item is not empty.
If you compare your list against another dynamic one, then it’s difficult.
Hi @emmanuel, I pinged the Bubble account, but it looks like you guys haven’t been online in that account for some time.
Is it worth me separately submitting a bug report / feature request for this?
To summarise the issue: If the condition is a single field, the rule can check whether X is “a string”, but if the condition is a list, the rules are currently unable to check whether Y contains “a string”.
This is on our list of things we’d like to add, but it’s not a simple project (has a lot of implication on the database side of things to ensure this works with good performance). So it’s on our list, but I unfortunately cannot give a timeline.
Still no update after 4 years on this. I guess this is a really difficult to implement but it’s really important to push Bubble.io to the next level.
Overall, managing list intersection in Bubble server side is almost impossible. Please, leverage the best researches on arrays and matrix mathematics, and secure that performing algorithm we all need