Back

[Solved] listDocuments() in dart_appwrite appears to be honouring document permissions

  • 0
  • Self Hosted
  • Databases
Cord
5 Dec, 2023, 16:36

I'm using dart_appwrite for a server application and have been successfully retrieving documents - for several months - from a collection that has document level permissions set. Today, while debugging a new function added to the server application, I suddenly started getting no results being returned from listDocuments() in a function that has not been changed since the server application was deploy.

On further inspection, if I add the Any() permission to a document, listDocuments() returns that document. Surely this is unexpected behaviour? What could be causing it?

Appwrite 1.4.8 dart_appwrite 10.1.0

TL;DR
The user was experiencing an issue with the `listDocuments()` function in dart_appwrite not returning any results while using document-level permissions. After deleting and creating a new API key, the function started working as expected. However, the user was unsure why the original key stopped working. It was suggested to regenerate the key and try again. After regenerating the key, the function worked properly and returned the expected results. The issue was resolved.
Cord
5 Dec, 2023, 17:01

listDocuments() in dart_appwrite appears to be honouring document permissions

Drake
5 Dec, 2023, 18:02

That sounds pretty odd...are you sure the API key is valid?

Cord
5 Dec, 2023, 18:29

It's the same key I've been using since the start of the project. I can regenerate it and try again. But with that key, and the existing document permissions, I get no results returned. If I then add Any() Read permissions to a few documents, then those get returned.

Cord
5 Dec, 2023, 18:30

I'll regenerate the key and try again. Perhaps something has gone astray.

Cord
5 Dec, 2023, 19:04

Well, interesting. I deleted the key and created a new one. And it works as expected. Very curious!

Cord
5 Dec, 2023, 19:04

I'll update the topic to indicate that this is now resolved. Thanks @Steven!!

Cord
5 Dec, 2023, 19:05

[Solved] listDocuments() in dart_appwrite appears to be honouring document permissions

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more