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
Summary
User is experiencing a `user_unauthorized` error while trying to read a document from a collection. They are considering creating a function that all document creation would have to route through. They are also considering disabling document security but are unsure if that is a good solution. They mention clearing the cache and logging out to resolve the issue but are still unable to access the document. Another user suggests calling `account.get()` before fetching the document and checking for a session in the client app. User confirms that they are not logged in and realizes that they can't access the document because they created it using the console. They are advised that if document security
Vedsaga
Rank 5: Hypervisor
Apr 2, 2023, 16:27
I mean this
Vedsaga
Rank 5: Hypervisor
Apr 2, 2023, 16:28
for development I just added it for now
Drake
Admin
Apr 2, 2023, 16:28
Oh...if document security is disabled, the permissions on the document don't do anything
Drake
Admin
Apr 2, 2023, 16:28
Ok and?
Vedsaga
Rank 5: Hypervisor
Apr 2, 2023, 16:29
I wonder then why I still can't access the document... may be I guess because I created it using console
Drake
Admin
Apr 2, 2023, 16:33
What's your code or what's the network log?
Drake
Admin
Apr 2, 2023, 16:34
So you can access the document now? But if you remove guest, you can't access the document?
Vedsaga
Rank 5: Hypervisor
Apr 2, 2023, 16:34
yap correct
Vedsaga
Rank 5: Hypervisor
Apr 2, 2023, 16:35
I didn't got this
Drake
Admin
Apr 2, 2023, 16:35
That means you're not logged in. There's no session
Vedsaga
Rank 5: Hypervisor
Apr 2, 2023, 16:35
😶🌫️
Vedsaga
Rank 5: Hypervisor
Apr 2, 2023, 16:35
let me check
Vedsaga
Rank 5: Hypervisor
Apr 2, 2023, 16:35
Vedsaga
Rank 5: Hypervisor
Apr 2, 2023, 16:35
it does show
Drake
Admin
Apr 2, 2023, 16:36
This is in the console. In your client app, there's no session or at least it's not being used
Vedsaga
Rank 5: Hypervisor
Apr 2, 2023, 16:36
umm, let me try logging out
Drake
Admin
Apr 2, 2023, 16:36
Try calling account.get() before you fetch the document
Vedsaga
Rank 5: Hypervisor
Apr 2, 2023, 16:38
I have made a appwrite service which act as centeral point of interaction between server and client
Vedsaga
Rank 5: Hypervisor
Apr 2, 2023, 16:39
mm, I guess you are right now seems to be working after clearning cache
Vedsaga
Rank 5: Hypervisor
Apr 2, 2023, 16:39
I wonder what approach would you suggest for this
Vedsaga
Rank 5: Hypervisor
Apr 2, 2023, 16:40
or should I disable the document security which I feel is bad honestly to solve this
Drake
Admin
Apr 2, 2023, 17:28
If you require different access for different documents, you must use document level security
Drake
Admin
Apr 2, 2023, 17:29
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
Vedsaga
Rank 5: Hypervisor
Apr 2, 2023, 17:31
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