Julian
Julian

Reputation: 81

Sails.js policies not working when controller in folder

after a bit of time, I found why my policies were not working.

I have the following file tree:

myProject > api > controllers > v1 > UserController

When i was applying my policy to UserController, nothing would change:

UserController: {
    '*': 'sessionAuth',
}

I then tried moved the UserController under controllers :

myProject > api > controllers > UserController

This worked.

So my questions is the following, can I still have the v1 folder and have policies working? I want to be able to have version folder. The suggestion made here is not really great, prepending all your controller with a version number is a bit redundant to me. Nested Models and controllers in sails are not working Policies

Looking forward to hear your thoughts!

Thanks

Upvotes: 1

Views: 329

Answers (1)

Mujtaba Kably
Mujtaba Kably

Reputation: 755

'v1/userController':{ "*":true }

Upvotes: 1

Related Questions