StrongLoop: hiding method updateAttributes()

给你一囗甜甜゛ 提交于 2019-12-08 11:19:28

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!