monocle-ts
monocle-ts copied to clipboard
generating lots of paths with optional steps and sets of steps
📖 Documentation
this is a documentation issue as well as a question about optics in general,
Let's say for security and authorization on a graph database I wanted to deny all traversals by default. All traversals begin at the vertex which corresponds to the user who submits a data request (subject) and end at data which that user may or may not be authorized to access
How can we use optics (monocle or just the general concept) to define a SET of paths which would be allowed to traverse?
for example,
rule = (
// define a set of paths:
["Provider", Maybe["CareTeam"], Maybe["Group"], "Patient", {"Condition", "Observation", "Treatment"}],
// define a set of operations allowed
"CRUD"
)
otherwise, if we have to specify each option in the maybes, and each option in the sets, it just blows up combinatorially to the point it's not possible to maintain. That's why im interested, what this would be called in functional programming /optics terminology?