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
- Cannot add/update array field
How do I add or update the rows, How exactly to pass properties? (see provided image)
- TablesDB not available in FRA?
Hi, in the cloud version, v1.8.0 Frankfurt, is it possible to use TablesDB ? I donβt see that feature in the console.
- Query.equal error
Hi guys. I'm using Appwrite Cloud, and I'm using version 21 of node-appwrite to benefit from transactions. The problem is I seem to be getting an error when I u...
