Back

Error on permission for updating all categories except Any

  • 0
  • Databases
  • Web
  • Storage
Los Feliz
23 Aug, 2024, 23:54

Hello, My question is about setting the permission for updating the documents of the collections. My vite reactjs web app uses Google sign for adding the users to my users collection. Those users can make notes which get saved in another collection called notes. Since I use Google to add users to my users collection, is "Any" the only group that I can give permission to modify my notes collection? I have tried other groups, but all of them give the error about the lack of authorization.

This is the flow of the application:

  1. The user opens the vite reactjs web app.
  2. They do not see anything expect the Sign in with Google button.
  3. They sign using their Gooogle account and their email and username gets saved in the users collection.
  4. They are taken to a page where they can create notes.
  5. After writing the note and clicking on "post", their note is saved in the notes collection.

Currently, the only way that I have been able to make the users post notes that were successfully saved in the notes collection has been by setting the permission for notes collection to "Any." When I select any other group, I get the error about the lack of authorization for performing that action.

I do not have any accounts in the Users or Team category of the Auth section, as the account information comes from the users' Google account and the necessary information gets saved in the users collection of my database.

Any clarifying comments about the cause of this is greatly appreciated.

TL;DR
Error encountered when trying to set permissions for updating collections, specifically for 'notes'. Users authenticated with Google can add notes which are saved in the 'notes' collection. Only able to grant permission to 'Any' group and not other groups without encountering authorization error. No accounts in Users or Team category in Auth section as user info comes from Google accounts. Need insights on issue cause. Solution: Ensure proper authentication setup for various user groups to prevent authorization errors when modifying collections.
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