Hello, I have enabled document security.
I want to allow a different user. How can I do this?
Error :
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)]Unhandled Exception: AppwriteException: user_unauthorized, Permissions must be one of: (any, users, user:1478dd7f-1b7e-4548-852b-ba29d8329a75, user:1478dd7f-1b7e-4548-852b-ba29d8329a75/verified, users/verified) (401)
TypeScript
database.createDocument(
databaseId: "65ba4d642a413bcc21f6",
collectionId: "663272610032aa962358",
documentId: const Uuid().v4(),
data: {
"senderId": "1e8e38e2-6817-4a58-87db-f1a25196812f",
"receiverId": "1478dd7f-1b7e-4548-852b-ba29d8329a75",
"content": msg,
"conversionId": "6634c2660033787315f6",
},
permissions: [
Permission.read(Role.user("1e8e38e2-6817-4a58-87db-f1a25196812f")), // Friend ID
Permission.read(Role.user("1478dd7f-1b7e-4548-852b-ba29d8329a75")), // My ID
],
);```
TL;DR
The developer wants to authorize another user for accessing documents but is facing an "user_unauthorized" error. The permissions specified only allow access for the specified users. Add the permission for the new user "1478dd7f-1b7e-4548-852b-ba29d8329a75" using the correct format to resolve the issue.Recommended threads
- type generation on same columns in table
is there way to prevent this ? or only need to update column name like table prefix?
- Custom Topic sent from Function (with sc...
Can I send a message on a custom topic? So clients can subscribe to them?
- WEBP preview not working after upgrading...
Only with preview, I'm getting this error: {"message":"no decode delegate for this image format `WEBP' @ error\/blob.c\/BlobToImage\/481","code":400,"type":"sto...