Back

`user_unauthorized` error when relation to other collection exists

  • 0
  • Android
  • Cloud
Ramon
10 May, 2024, 22:16

I have a Users and Lists collection inside my Appwrite database. Users and Lists have a two-way relation with each other. When I query the database for a specific User with its DocumentId, I get a valid response, as long as there is no List added to the user. When I connect a List to the user (relation), I get an user_unauthorized response. Event though I have Any: Read permissions inside my Users collection and also inside the Lists collection. Document security is disabled. Am I doing something wrong? My goal is to retrive the user and all lists which are related to that user.

TL;DR
Issue: `user_unauthorized` error occurs when querying for a specific User with a connected List. Solution: This error may be due to the user's document not having the necessary permission to access the Lists collection when a relation exists. Ensure that the user has Read permissions not only in the Users collection but also in the Lists collection. Double-check the permissions for both collections even though Document security is disabled. The goal is to retrieve the user and all related lists successfully.
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