Answer the question
In order to leave comments, you need to log in
Is there any out-of-the-box tree ACL solution that will allow to get a list of objects allowed to a user for node.js?
There is a task to store multi-level lists of objects (taxonomy, and objects are attached to taxonomy elements), and multi-level groups (groups include users) and grant rights.
For example, you can grant rights to a taxonomy element for a parent group, and all members of child groups must be given rights to objects bound to the child elements of the taxonomy.
For example, https://github.com/PrivateSky/acl-magic allows you to do such a thing.
But it does not occur to me how to proceed from the opposite, and show the user a list of objects to which he has rights.
Of course, pulling out all the objects from the database and checking one by one can work, but this is not at all optimal.
Answer the question
In order to leave comments, you need to log in
As a result, having not found a ready-made solution, I settled on CASL and decided to use mongodb. CASL has mongo support, and has chosen to store all parent taxonomy terms in the document. An array of parent elements is populated via the save hook in mongoose.
This approach worked well on samples, but changing the structure became a very painful process.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question