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
- Locked out of account
Hey guys, I have a paid account and have been locked out. Apologies for using this method, but I'm getting no response via the contact us page. I had a old do...
- Transaction Error
AppwriteException: Transaction with the requested ID could not be found. at Generator.next (<anonymous>) { code: 404, type: 'transaction_not_found', r...
- Can not get the logged in user data in N...
I'm trying to get the user data after i log in with otp but it get this error : AppwriteException: User (role: guests) missing scopes (["account"]) at Gen...