Web Developer
i write in nodejs,
I create a document, and this specific document should be available only to the current user. so i add permissions:
clubsCollectionId,ID.unique(), { ...club, owner: this.currentUser?.$id // This is for me - to check permissions myself! },[ Permission.read(Role.user(<string>this.currentUser?.$id)), Permission.update(Role.user(<string>this.currentUser?.$id)), Permission.delete(Role.user(<string>this.currentUser?.$id)), ])```
However, when i want to get the documents, i aim to have ONLY thouse i have access to:const ans:ApiResponse = await databases.listDocuments(
conf.appwriteDatabaseId,
clubsCollectionId,
// [
// Query.equal("owner", [this.currentUser?.$id]) // This is my check
// ]
);
return ans
Now, should I do manually this check ? or Appwrite sould check the permission before returning the answer ?
Am i using the permissions wrong?
