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
- Help with 409 Error on Relationship Setu...
I ran into a 409 document_already_exists issue. with AppWrite so I tried to debug. Here's what I've set up: Collection A has 3 attributes and a two-way 1-to-m...
- Database Double Requesting Error.
I am getting error for creating new document in an collection with new ID.unique() then too getting error of existing document. When button is pressed one docum...
- JSON and Object Support in Collection do...
I am working with Next.Js and Appwrite Cloud, I am relatively New to Appwrite but i have noticed there is no direct support of JSON and Object support in attrib...
