I keep getting an error saying the current user is not authorized to perform the requested action, when I'm trying to create a row a table. Permissions have been set for create, read, update and delete for Users on the table in question and I've given the function full auth and database scopes and its not working.
The function does not access storage or messaging.
In order to avoid a code dump, this specific line is where it fails:
const drawEntry = await database.createRow<DrawEntry>({ databaseId: "68c2503d0005d71c2f12", tableId: "draws", rowId: ID.unique(), data: { userId: userId, idm_key: body.idm_key, card: thisDrawAttempt.card, timestamp: now, outcome: "pending", }, transactionId: transaction.$id });
Of note, I fetch userId as follows: const userId = req.headers["x-appwrite-user-id"];
and the transaction is created as: const transaction = await database.createTransaction();
This error is frustrating because I basically can't move forward with the project, and no other tables or functions in the project are giving me this issue despite having similar permissions. Please help.
Recommended threads
- Project Paused Despite Daily Active Usag...
I noticed that my project was automatically **paused**, even though it is actively being used. The project is an **attendance application** that is used daily b...
- Hi Appwrite Support Team,My project has ...
Details: Project ID: 69a69f6f00113ed0e8e4 Region: SFO (sfo.cloud.appwrite.io) Error Response: Affected: ALL endpoints ā Functions, Databases, Storage, Health, ...
- Sudden CORS Errors - Domain hasn't Chang...
I have an Appwrite project with two web apps configured, the first one has the hostname `*` and the second one I just added to test if it could fix the issue wi...