disableRemoteMethod does not work in boot script
/server/boot/initializer.js
app.models.Foo.disableRemoteMethod("find", true);
Above code doest not affect anything.
@jmimi I was trying to reproduce your issue, it seems like the method still shows up in the API explorer, but the call to the method itself does become 404 Not found for me. Is this also your case? Or your endpoint is still call-able.
@davidcheung I forgot what is exactly the case. But I'm sure disableRemoteMethod should be call in model definition
@jmimi I'm trying to see if this could be a bug with the remote layer, so we can identify where the issue is coming from, and when I was trying to reproduce the call becomes 404 when I run
app.models.Foo.disableRemoteMethod("find", true);
But the method still appears in the explorer for me.
disableRemoteMethod does get called, and makes function uncallable, not unviewable,
But I'm sure disableRemoteMethod should be call in model definition
@bajtos would you know what the intented behavior is? should we grey out the method in API-explorer or to Hide it completely?
@davidcheung Why there is different behaviour between calling in boot-script and model-definition?
disableRemoteMethod does get called, and makes function uncallable, not unviewable
This is expected. We don't have a mechanism to notify loopback-component-explorer that a method was disabled.
A similar case is adding a new model after explorer was initialised. To address that, we modified loopback to emit an event when a new model is added to the app, and now there is a pending patch https://github.com/strongloop/loopback-component-explorer/pull/141 to listen for that event in explorer.
I think we should do the same for remote methods.
@davidcheung I think the triage is done here and the issue can be labelled as "feature" + "Beginner friendly".
I have submitted 2 PRs to solve this issue (#2266 and strongloop/loopback-component-explorer#157).
@bajtos This issue was solved. You can close this issue.