GodotNuts / GodotFirebase

Implementations of Firebase for Godot using GDScript
MIT License
530 stars 76 forks source link

firestore missing permissions when query allowed collection [BUG] #347

Closed NIKHIL0VERMA closed 1 year ago

NIKHIL0VERMA commented 1 year ago

Describe the bug Can't access the documents through query. I have a firebase project in production and firestore rules were setup to allow reading of players collection. Firestore has 2 collections players and token writing to players collection required auth and uid matching token is private for individuals and rules are according to it.

When I try to query players collection.I encounter get missing permissions error.

I can access documents through firebase rest api using chrome, brave and firefox.

To Reproduce

  1. Create multiple collections
  2. allow read to all documents in any collection
  3. secure write with auth and uid
  4. others with read, write only auth users
  5. query the documents from allowed collection

Expected behavior var query : FirestoreQuery = FirestoreQuery.new().from("players").order_by("score", FirestoreQuery.DIRECTION.DESCENDING) var result: Array = await Firebase.Firestore.query(query).result_query this should give me the documents from firestore

Environment:

Additional context I'm new to Godot and this is my re-creation of project. Never encounter this error, using same rules in live app till last year.

WolfgangSenff commented 1 year ago

Did you authenticate? What is the exact error you're getting? Do you have an index setup correctly for that field? What platform are you exporting for/using to debug?

NIKHIL0VERMA commented 1 year ago

Using Anonymous login. This is what I got image

Using automatic indexing of firestore

I just ran it locally in godot only to test things out.

NIKHIL0VERMA commented 1 year ago

Today I created new firebase project, it works fine with same setup. But there is this special project giving me hard time untill now. I just remind that I had enforced the app check for all api call that cause permission denied error. Current there is no app check option in this plugin as long as I remember. So unenforcing is the key in my case. The plugin is fine, there is nothing to do with it.