Seroga88iOriginal post
Web Developer
Hello guys,
I create documents and provide an array of permissions but when another user logs in and loads the data the second user can load the data from the first user.
I use following code:
final response = await databases.createDocument(
databaseId: databaseId,
collectionId: collectionId,
documentId: ID.unique(),
data: data.toMap(),
permissions: [
Permission.read(Role.user(user.$id)),
Permission.write(Role.user(user.$id)),
Permission.update(Role.user(user.$id)),
Permission.delete(Role.user(user.$id)),
],
);
In the web console i can see that the document has the right flag with user:
Still do not understand why the second user can see the data.
Do you have an idea what I am missing?
Kind regards
Summary
Issue: Permissions set for documents in Flutter not working correctly, allowing second user to access data intended for first user.
Solution: Check permissions implementation in the backend to ensure that only the specified user has access to the document. Additionally, verify that the permissions are correctly assigned and enforced.