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
- Cant get realtime working
Hey I nned some help with realtime a gain. I was using client.subscribe(...), and i found out that its depricated then i believe realtime.subscribe(...) is the ...
- Firebase app import
I'm **very** new to appwrite and I just set up appwrite with docker and I'm trying to import a Firebase app I have set up but it's erroring and I don't really k...
- Hi Folks, Database Writing Issue
Hey Folks im trying to get logging setup on my website but im getting an error, i dont have any document id and i think this is the issue but i havent got the f...