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
- Query params are way too limiting in ter...
I was trying to list rows in a table that do not already exist in another table. I retrieved around 260 row IDs which are 13 characters in length each, and then...
- Relationship null, even when relationshi...
Hi Everyone, im experiencing issues with set relation data. When im setting the document id from the related database most of them seem fine, except one table. ...
- REQUEST FAILED IN MIGRATION
I was trying to moved my archived project to a self-host database . Though the Project is "read only" but there's a message that I can view and migrate data to...
