
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
- REQUEST FAILED IN MIGRATION
I was trying to moved my archived project to a self-host database . Though the Project is "read only" but there's a message that I can view and migrate data to...
- Is it possible to getRow with all relati...
With the new Opt-In relationship loading, is it possible to query getRow to get all attributes and relationships and possibly even cascading relationships? I tr...
- TableDB.getRow() response does not conta...
This is for Web/React sdk 20.0.0 The row was created via `TableDB.createRow(...)` and I can see it in the console with the relationships correctly set. In the c...
