helpful-traffic-4919
06/16/2023, 11:50 AMpurple-match-65245
06/16/2023, 12:33 PMpurple-match-65245
06/16/2023, 12:39 PMpurple-match-65245
06/16/2023, 12:40 PMhelpful-traffic-4919
06/16/2023, 1:16 PMSELECT * FROM documents d WHERE d.text="something super important"
• Filter: Foreach result: filter {document.isPublic || document.ownerId == 1234 || keto.checkPermission(user, document, "read")
As for the layered approach, I’d mulled that too. Say the user is searching within a ‘Collection’ of documents, and the Collection in Keto grants the requested permission to the given user for constituent Documents - then filtering in the database for Documents that are members of the given Collection is sufficient. So in approximate practise:
• User requests read permission for documents in the ‘dogs’ Collection
• App runs:
if keto.checkPermission(user, dog-collection-id, "read") {
return SELECT * FROM documents d WHERE d.parent_collection = <dogs-collection-id>
} else {
// default filtering
}
Again denormalization, replicating the collection/document hierarchy in Keto and the database.
However you cut it, it leaks the permission outside of Keto which irks, but I have feeling pragmatism trumps
Pretty early thinking though, I too am formulating!purple-match-65245
06/16/2023, 1:18 PM