Back

Unauthorized deleteDocument

  • 0
  • Databases
  • Web
  • Cloud
Peter
28 May, 2024, 12:24

I want to delete a document as a user (which has document permissions including delete), the document has a relation (the user has also document permissions on that document including delete).

I keep getting AppwriteException: The current user is not authorized to perform the requested action.

The typescript code I use to delete the document: export async function deleteDocument(id: string) { return await databases.deleteDocument( DATABASE_ID, COLLECTION_ID, id ); }

TL;DR
Developers are getting an "Unauthorized" error when trying to delete a document, even with proper permissions. The issue may be with the relationship between the user and the document needing to be deleted. Double-check the permissions set for both the user and the document.
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