Is there a known way to disable specific blueprints
on the per-controller level in sails.js
?
I've read how to disable ALL blueprints
on the app level, and how to disable ALL blueprints
for an individual controller
but is there a way to disable a subset of the blueprints
on an individual controller
?
This documentation covers the basics, including disabling all blueprints
per controller,
https://github.com/balderdashy/sails-docs/blob/master/reference/blueprint-api/blueprint-api.md
But say I have a Counties
model and I want the find
actions available (find()
and findOne()
), but do not want the others.
Is that an option?
You can override them in the controllers. For example,
update: function (req, res) {
res.forbidden();
},
destroy: function (req, res) {
res.forbidden();
}
This is one way. Other and more preferred way is to use policies:
myController: {
'find': true,
'findOne': true,
'*': false
},
This will only expose find and findOne and hide other actions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With