I have a Database and collection, that my web app is trying to query, and I am getting 401 unauth It was working before i upgraded to 1.4.0.
I verified the permissions on the collection, even added "Any" and "All Guest" and "All Users" (Even though my user is in a Team with full perms to the collection)
Logged out and back into the app, same thing. another collection is working fine, no idea why this isnt working.
Any relationships in this collection?
yes, oooh, check perms on the related collections?
that was it. didn't even think to check relationships
So the user didn't have access to the related document?
yeah, i had created a new collection (related) and hadnt set permissions on that yet
@Prateek Banga do you have some time to help with this? Should a user get a 401 if they don't have read access to a related document?
Hmm, will have to see. I'll check this out tomorrow. The user should get document without the related document i think without read permission in related collection.
@Zeke(Jafesu) can you try out upgrading to 1.4.1 and then try out your use case without having permission in related document. Technically, you should see the document without any related data if you don't have any permission for related collection.
I tried reproducing this in 1.4.1 and it's not a problem for me
Yep. I'm on 1.4.1 I'll text this afternoon
You can share the appwrite.json via appwrite-cli to help reproduce the bug. Use the Appwrite CLI: https://appwrite.io/docs/command-line-deployment#initializeProject
Looks like the issue was resolved
Not getting the error anymore
great then, I'll mark this thread as SOLVED
[SOLVED] Getting 401 User Unauthorized when doing a getDocument
@Prateek Banga isn't fixed after all
https://github.com/appwrite/appwrite/issues/new?assignees=&labels=bug&projects=&template=bug.yaml&title=%F0%9F%90%9B+Bug+Report%3A+ can you please raise a bug over here? Reproduction steps would be great
Getting 401 User Unauthorized when doing a getDocument
@Steven I was not able to reproduce this. If you get some time, please try to reproduce this.
Recommended threads
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...