Hi there, I want a user to update a Document he has read, update and delete permissions to. Now until he is the only one having any permissions this call works fine:
Document result = await databases!.updateDocument(
databaseId: AppConstants.privateEventsDatabaseId,
collectionId: AppConstants.eventsCollectionId,
documentId: event.id!,
data: event.toJson(),
permissions: event.appwritePermissions,
);
The method event.appwritePermissions creates a List<String> looking like this:
permissions = [
"read("user:648ade3b69d58f61c640")",
"update("user:648ade3b69d58f61c640")",
"delete("user:648ade3b69d58f61c640")",
"read("user:64df7d4a4cb958d68e76")",
]
Which is the same I get from Appwrite.
Question is, why cant I update the permissions in this form?
The full error looks like this:
AppwriteException (AppwriteException: user_unauthorized, Permissions must be one of: (any, users, user:648ade3b69d58f61c640, user:648ade3b69d58f61c640/verified, users/verified) (401))
A user can set permissions of a document to is own or users or any to set permission to other users you'll need to use the database server side SDK and you can do so using a function.
Ah okay, I thought a user with write permissions could set the permissions of other users too
SOLVED: Update Document permissions fails: user_unauthorized
Recommended threads
- Bandwidth limit for your organization ha...
I received an alert that I exceeded the Free plan bandwidth limit (showing 5.86 GB), but my dashboard tells a different story. The usage stats there are much lo...
- cli broke with new varchar type??
``` appwrite types ./appwritetypes ℹ Info: Detected language: ts ℹ Info: Directory: ./...
- Weird Query Error
In next js I am getting this error in the image ```js queries: [ Query.equal('title', TitleId), Query.limit(10) ] ``` am I doing something...