Reputation: 615
In Sails.js v0.10, I can set whether or not to expose REST routes for controllers by setting the rest
property in config\blueprints.js
or by setting _config: { rest: true } //or false
in the controller definition.
Does anyone know if it's possible (and how) to set this for some REST routes but not all?
For example, something like rest: { find: true, create: true, destroy: false, update: false }
I realize there are workarounds, but it would be nice to be able to set the defaults in one line.
Upvotes: 2
Views: 1067
Reputation: 113
you can duplicate the default blueprint api and remove unwanted js files and in your routing bind the routes to the specific custom blueprint you made. it will work
Upvotes: -1
Reputation: 1250
you can use policy setting like below. this will allow find but disable the other method.
'Foo': {
'*': false,
'find': 'sessionAuth'
}
Upvotes: 4