Hi,
I'm looking to write schema validation + access control library for sharedb backend.
I want the API to look like this:
harden( backend, schema );
It looks obvious to go this way:
backend.use [ "query", "submit", "after submit" ], (req, next) => validateAccessRights();
backend.use "after submit", (req, next) => validateSchema();
I'm able to validate the operation result against schema at "after submit" hook, but operation is applied despite of error I'm trowing, can I then roll it back somehow or prevent?