Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

257
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda