隐藏 LoopBack PUT REST API 方法

Hide LoopBack PUT REST API method

如何在 LoopBack 中隐藏 PUT REST API 方法?我已经能够成功隐藏许多其他方法,但不能隐藏 PUT 方法。

> $ slc -v
strongloop v2.10.3 (node v0.10.35)
├── strong-arc@1.1.0
├── strong-build@1.0.3 (5a43a57)
├─┬ strong-supervisor@1.4.1 (c945bd1)
│ └── strong-agent@1.3.2
├── node-inspector@0.7.4
├── strong-deploy@1.1.4 (5e25e21)
├── strong-pm@1.7.2 (315d448)
├── strong-registry@1.1.4 (aab3dbb)
├── nodefly-register@0.3.3
└── generator-loopback@1.7.3 (9dc370f)

隐藏方法:

module.exports = function(Studio) {
    var isStatic = true;
    Studio.disableRemoteMethod('deleteById', isStatic); // DELETE /Studios/{id}
    Studio.disableRemoteMethod('create', isStatic); // POST /Studios
    Studio.disableRemoteMethod('upsert', isStatic); // PUT /Studios
    Studio.disableRemoteMethod('updateAll', isStatic); // POST /Studios/update
    Studio.disableRemoteMethod('updateAttributes', isStatic); // PUT /Studios/{id} *What is this supposed to be?*
};

如何隐藏 PUT /Studios/{id}。文档表明它是 updateAttributes,但我已经尝试了所有可能的组合,但都没有成功。 http://docs.strongloop.com/display/public/LB/Exposing+models+over+REST#ExposingmodelsoverREST-HidingmethodsandRESTendpoints

我认为您必须对方法 "updateAttributes"...

使用 isStatic = false