[SOLVED] Getting error when setting permission of a document during its creation
- 0
- Databases
- Accounts
Hi! Following is my code:
await databases.createDocument(
'DB_ID',
'COLLECTION_ID',
user.$id,
{
name: user.name,
age: 20,
college: 'Harvard'
},
[Permission.update(Role.user(user.$id))]
);```
But I'm getting this error: `AppwriteException: Permissions must be one of: (any, guests)`. Any idea what's up? Note that, I'm creating the account immediately before this, with `user = await account.create(...)`
Hi - let me take a look and brb
You need to enable document level permissions and allow user to create documents.
When you create the document, you can put yourself for update access so you can update.
The error in your original post is occurring because you're not authenticated
@nightwielder make sure that u have also Created the attributes of data for the documents in the appwrite console
[SOILVED]Getting error when setting permission of a document during its creation
[SOLVED] Getting error when setting permission of a document during its creation
Recommended threads
- How to bypass the rate limit on the back...
Once a month my app has a ton of usage and I always run into the Too many requests 429 error. I am trying to optimize the queues and jobs to manage that, but a...
- [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...