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
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...
- custom domain with CloudFlare
Hi all, it seems that CloudFlare has blocked cross-domain CNAME link which made my app hostname which is in CloudFlare, unable to create a CNAME pointing to clo...
- Custom emails
What happen if I use a third party email provider to customize my emails and my plan run out of emails/month? Appwrite emails are used as fallback sending emai...