Hi im trying to create a document.. i want to give some users access to read the document... im using
[ Permission.read(Role.user("62f5509c95b3ca818386")), Permission.read(Role.user("62eda8240ae7ce3ec563")),
]
but im getting this error
[AppwriteException: Permissions must be one of: (any, users, user:62f00557d69fcfbe9c1e, user:62f00557d69fcfbe9c1e/verified, users/verified, team:paidUsers, member:62f5509c95b3ca818386, team:paidUsers/paidUsers)]
When using a Client side SDK the user can give permission only to any, users, or any thing in the list including the user itself.
But, if you want to give permission to other users you'll have to use the Server sdk
P.s. It's actually doesn't mentionedit at the permission documentation in the website But, you can read it here https://github.com/appwrite/appwrite/blob/master/app/controllers/api/databases.php#L2690
And it does sounds right and make sense that the user will have option to let give other user permissions if that user is the owner of the document.
As of now Appwrite doesn't have the document-owner logic so you'll have to go with a function.
what is the difference bw client sdk and server sdk?
First you can check here https://appwrite.io/docs/sdks
In general
- Client - User/guest based. limited.
- Server - With API key can do almost everything.
does the permission rules applies to storage also?
but what is reason for not allowing ?
I think it's security wise. But, I see your logic I'll recommend search, or create a feature request for it.
Recommended threads
- Realtime for files() works almost well, ...
I have been trying to make use of realtime, today (14.03.26) I have pulled all the latest versions of docker images, and sdk available. Whats working: - Conn...
- Function issue
Hi,idk whats wrong with my function but i made some changes to the env var and made sure they saved then i redeployed it,but then after it redeeployed it asked ...
- Function issue
Hi,idk whats wrong with my function but i made some changes to the env var and made sure they saved then i redeployed it,but then after it redeeployed it asked ...