问题
I've managed to take out some of the predefined methods from my rest API using this code wich I adapted from the documentation:
var app = require('../app');
var News = app.models.News;
News.create.shared = false;
News.upsert.shared = false;
News.deleteById.shared = false;
However, this same code breaks when I try to hide the updateAttributes() predefined method. Does anyone know how come this is?
回答1:
You should do:
News.prototype.updateAttributes.shared = false;
回答2:
The one provided by Raymond did not work for me
I used this
MyModel.disableRemoteMethod('updateAttributes', false);
Which is stated in the Strongloop docs; the key here is the false.
来源:https://stackoverflow.com/questions/24124534/strongloop-hiding-method-updateattributes