Everyplay / serverbone

Backbone node.js additions to serve backbone collections/models over express
MIT License
5 stars 5 forks source link

Refactor fetching of relations, ACL checks #22

Open mzabaluev opened 9 years ago

mzabaluev commented 9 years ago

The proliferation of various fetching methods and options makes the code unnecessarily fragile. Some of it is done to manage relationship fetching as required by the projection, but the ACL checks add fetchACLDependencies. This is meant to be an orthogonal operation to the schema-driven fetching, but the relations needed for ACL often overlap with the model data relations.

Another problem with ACL-through-relations is that models fetched into a collection don't share relations, so fairly big objects may end up being repeatedly fetched for each model.

Here's a list of proposed changes: