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
- Re-connect site to domain verification f...
I have mistakenly deleted appwrite site without removing domain. Now I created same site and want to re-connect my domain. It gives this error while verify. How...
- SSR share session to client using custom...
Hi, so I was trying to get a hang of using SSR and using realtime updates in the same time which is done easiest if you have a custom domain in Appwrite and as ...
- Custom Domains with Cloudflare for SaaS ...
Hi! I'm using Appwrite Cloud Sites with Cloudflare for SaaS for multi-tenant custom domains. Problem: Custom domain: donate.pekeetong.my → CNAME to sites.dono...