1

Sails.js provides blueprint routes for GET, PUT, POST, DELETE which are mapped to find/findOne, update, create and destroy actions of the controller. Now, I recently read this article about the functionality of white listing attributes in Rails, which tells which attributes can be updated via mass update, which also secures the API from surprise changes.

I am trying to find out if there is some functionality like that in built in Sails ?

Mandeep Singh
  • 7,674
  • 19
  • 62
  • 104

1 Answers1

2

I don't think that sails has this functionality. You'll probably have to override the blueprint methods in the controllers to declare the white list there.

You could also implement this functionality by overriding the update blueprint. You could had some code that looks for a attr_accessible attribute in the model and clean the values.

Have a look at this answer to see how to override blueprints.

Community
  • 1
  • 1
Alexis N-o
  • 3,954
  • 26
  • 34