[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
- Weird permission failure
when creating an account I use following methods: ``` Future<void> register(String email, String password, String username) async { final user = await accoun...
- Relation Question
How do I create a relation from table y to an others x.$id. in my example I have a users table where I use Appwrites unique User IDs and I want other tables fo...
- Unknown attribute type: varchar / text
Since the `string` type is deprecated I tried using `varchar` and `text` in some newer tables, but when running `appwrite pull tables && appwrite types ./src/li...