Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

262
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda