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
- [SOLVED] Appwrite Cloud and FRA cloud se...
Can anyone estimate how long this will take to resolve? I am checking status here https://status.appwrite.online/
- How to use Operator.arrayAppend on a rel...
Hi, is it possible to use any operator on a relationship column? I have a One to Many relationship column on a table and I would like to add entries to the colu...
- Terraform tablesdb_column type inconsist...
Hi, I am trying out the new terraform provider for appwrite that was introduced a few weeks back. As a first step I wanted to import our existing databases into...