Skip to content

[1.0.0] Can't reload policies as in 0.12 #81

@Fr33maan

Description

@Fr33maan

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:

Hi sails team, I'm experiencing issues in sails-hook-autoreload and another hook with sails@1. I want to reload policies / edit policies w/ the hook. In sails 0.12 it was very easy but now I don't understand how to do that.
If I simple do sails.hooks.policies.initialize(), policies get duplicated in sails@1.
If I edit the sails.config.policies array nothing happens when I hit the route. I think that policies are directly binded in the router but even a router.flush does not work.
How should I do to fully reload policies without relifting the server ? Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions