Skip to content
Back

Problem When Creating Document with Child Documents

  • 0
  • Users
  • Databases
  • Web
  • Self Hosted
Tassos P.
8 Feb, 2024, 15:20

I have build a Next Js app. And for the Backend I am using appwrite. So far I have a solid DB with 3 different collections. 1st is the Client Collection, 2nd is the Job Category Collection and 3rd is the Jobs Collection on which I have as child collections the Clients with a relationship Many to one (jobs can contain one clients / clients can belong to many jobs) and the Job Category with a relationship Many to ONE (jobs can contain one jobsCategory jobsCategory can belong to many jobs).

Currently I have not implemented any kind of authorizatoin and on a collection level permissions I have enabled for all three collections for ANY to allow all actions. So so far I can create clients / update clienst , I can create Job Categories / update Categories etc but unfortunately when I try to create a new Job I get this error: (Error is: AppwriteException: The current user is not authorized to perform the requested action.). The bizzare thing is that if I create the job from the console, I can update the data of this certain Job from the client side UI thought.

Please kidnly advise me any possible solution....

TL;DR
Issue: When attempting to create a new Job using an app built with Next.js and appwrite as the backend, the developer receives an error stating "The current user is not authorized to perform the requested action." However, they are able to update the data of the Job from the client-side UI after creating it from the console. Possible Solution: The error suggests that there might be an issue with authorization settings. The developer should check the collection-level permissions in appwrite for the Jobs collection and ensure that the appropriate actions (such as creating a new Job) are allowed for the current user. Verify that the user has the necessary permissions to perform
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