firebase / firebase-js-sdk

Firebase Javascript SDK
https://firebase.google.com/docs/web/setup
Other
4.86k stars 891 forks source link

Firestore rule not working #8544

Closed bunyaminmrcn closed 1 month ago

bunyaminmrcn commented 1 month ago

Operating System

Apple M2

Environment (if applicable)

Chrome 129, Firefox 130

Firebase SDK Version

10.13.2

Firebase SDK Product(s)

Auth, Firestore

Project Tooling

Next.js

Detailed Problem Description

match /posts/{document} { allow read: if request.auth != null && resource.data.public == true; allow write: if request.auth != null ; allow list: if request.auth != null && resource.data.public == true; }

Steps and code to reproduce issue

I am logged as admin user. My error case happens in list . My posts collection of documents has public identifier/attribute. Real error is FirebaseError: Property public is undefined on object. for 'list' @ L39, Property public is undefined on object

google-oss-bot commented 1 month ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

bunyaminmrcn commented 1 month ago

IMG_20240928_191133_DRO.jpg

Here is a document in posts collection. Run succesfully in Rules Playground tool of Firebase

ehsannas commented 1 month ago

@yuchenshi could you take a look and/or route to the right person?

yuchenshi commented 1 month ago

As this issue isn't with the open source JavaScript SDK but with Firebase Rules (backend / emulator), please submit a Support ticket at https://firebase.google.com/support instead.