Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

255
Views
How do I stop a firestore web client from reading certain documents in rules based off a documents content?

For some reason I can run the rules simulator and it works perfectly (rejects reads on documents that have dedicated set to false) but the js app still pulls all documents if I remove the "Where" statement from:


    firebase.firestore().collection('live').where('dedicated', '==', false).onSnapshot
to
    firebase.firestore().collection('live').onSnapshot

I need to be able to list the documents, but not read the ones with dedicated = true. I know that rules are not filters, but I plan on keeping the where statement and still want to restrict the access to certain documents for security.

Rules:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /live/{document} {
      allow list: if true;
      allow read: if resource.data.dedicated == false;
    }
...
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Since your rules say:

allow list: if true;

This means that you allow API calls that retrieve a list of documents without any conditions.

If you only want to allow the first query, you should use:

allow list: if resource.data.dedicated == false;
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!