Getting `user_unauthorized` error while reading trying to document from the collection
- 0
- Databases
mm, thank you I guess I will add the permission while creating document... but one doubt I wonder how should I design arch, like should I create team for each business π€ and then when any documents get created just link the team to that document so that other team member can access
I mean this
for development I just added it for now
Oh...if document security is disabled, the permissions on the document don't do anything
Ok and?
I wonder then why I still can't access the document... may be I guess because I created it using console
What's your code or what's the network log?
So you can access the document now? But if you remove guest, you can't access the document?
yap correct
I didn't got this
That means you're not logged in. There's no session
πΆβπ«οΈ
let me check
it does show
This is in the console. In your client app, there's no session or at least it's not being used
umm, let me try logging out
Try calling account.get() before you fetch the document
I have made a appwrite service which act as centeral point of interaction between server and client
mm, I guess you are right now seems to be working after clearning cache
I wonder what approach would you suggest for this
or should I disable the document security which I feel is bad honestly to solve this
If you require different access for different documents, you must use document level security
Maybe a function to create the document where the function will put user and team in the permissions. Careful about letting the user update the document since they can update the permission to remove the team
if I make a function that all the document creation will have to route through it I guess, which seems not ideal I guess umm, I guess I will explain this problem in detail next Stage on next Thruday for now aim to first build logic layer for now
Recommended threads
- Type Mismatch in AppwriteException
There is a discrepancy in the TypeScript type definitions for AppwriteException. The response property is defined as a string in the type definitions, but in pr...
- What Query's are valid for GetDocument?
Documentation shows that Queries are valid here, but doesn't explain which queries are valid. At first I presumed this to be a bug, but before creating a githu...
- Appwrite exception: user_unauthorized, t...
After refreshing the app it is working perfectly