Open Fr33maan opened 7 years ago
@sgress454 Maybe you have a spontaneous answer ? :D
@l1br3 I'm afraid not. Policies in Sails 1.0 are implement as action middleware, and there's currently no mechanism for reloading the set of loaded action middleware. The only thing you could do is set sails._actionMiddleware = [];
to clear out the current set, which might work, but is using the private API so caveat emptor. Plus if any other hooks had added middleware (unlikely, but possible), they wouldn't know to reload.
@sgress454 That's a radical change. But maybe the solution to add policies with hooks ? I need it for my sails-role-permissions hook
@sgress454 Maybe I could list user's hooks to reload them once action middleware has been flushed ?
I don't understand how to reload policies.
sails.hooks.policies.initialize(cb)
will duplicate policies instead of replacing them.router.flush()
does not seems to help.I posted a message on gitter: