Reputation: 1555
I think the answer is no, because I can't find a reference in Firestore docs:
I have an ACL setup where users are assigned to one or more user roles (access lists essentially) eg
user.roles = [ 'a', 'b', 'c' ]
Each record can then also be made available to one or more user roles, also an array
record.access.roles = [ 'c', 'd' ]
I know I can query this on the front end using array-contains-any ... but I also need to secure the data with a similar condition returning true if any of the users roles appear the records ACL list. Currently I can only find documentation supporting an IN array condition.
In fact this section of the docs discusses the security around array-contains-any on the query side, but makes no mention if/how it's possible to secure the data this way.
Upvotes: 1
Views: 647
Reputation: 317402
If you want the equivalent of array-contains-any for the purpose of determining if items in a list are present in another list, I think you will want to use hasAny() on the list to check, and pass it the list of other items that should be checked for presence.
In general, I would lean on the API documentation that I linked to here, rather than the formal product documentation. The docs you linked do no show examples of everything you can do. The API documentation will help you understand all the functionality you have available.
Upvotes: 2