Hello I am reading in rows of data from a text file and then writing them as documents to AppWrite. I am the only user that can create, update and delete the documents. The documents can be read by 'Any'. I attach a screenshot of my Permissions. I am running my app locally on my PC. When I run my app I get this error message: Error creating document: AppwriteException: Permissions must be one of: (any, guests)
Here is the code. My understanding is that it is necessary to set the Permissions in the code, based on the example in the page https://appwrite.io/docs/advanced/platform/permissions and confirmed here: https://github.com/appwrite/playground-for-node/blob/master/src/app.js
I created a User and used that user in collection Permissions. I have Document permissions set on. I've copied the code from the AppWrite docs. I have confirmed the variable values for DATABASE_ID, COLLECTION, PROJECT_ID AND ENDPOINT and the UserID.
What am I missing?
await databases.createDocument(
process.env.DATABASE_ID,
process.env.COLLECTION_RESPONSES,
ID.unique(),
{
date: row[0],
firstname: row[1],
surname: row[2],
country: row[3]
},
[
Permission.read(Role.any()),
Permission.update(Role.user(process.env.USER_ID),"verified"),
Permission.write(Role.user(process.env.USER_ID),"verified"),
Permission.delete(Role.user(process.env.USER_ID), "verified")
]
);
Recommended threads
- Couldnt not do appwrite push tables
Not sure why i am not able to create my tables
- SELF HOSTING ISSUE, DATA NOT MIGRATING T...
Hey, devs, I recently tried to migrate my cloud instance to a self hosted version but my data is not transferred fully only the table structure is transferred ...
- No Document ID?
Hi I have a self hosted appwrite. My documents get a document ID but are not visible in the console. I don't know why this happens and how to fix this