Skip to content

disableRemoteMethod does not work in boot script #1869

Closed

Description

@jmimi

/server/boot/initializer.js

app.models.Foo.disableRemoteMethod("find", true);

Above code doest not affect anything.

Activity

  1. self-assigned this
    on Dec 9, 2015
  2. davidcheung commented on Dec 9, 2015

    @davidcheung
    Contributor

    @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.

  3. jmimi commented on Dec 14, 2015

    @jmimi
    Author

    @davidcheung I forgot what is exactly the case. But I'm sure disableRemoteMethod should be call in model definition

  4. davidcheung commented on Dec 17, 2015

    @davidcheung
    Contributor

    @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?

  5. jmimi commented on Dec 17, 2015

    @jmimi
    Author

    @davidcheung Why there is different behaviour between calling in boot-script and model-definition?

  6. bajtos commented on Dec 18, 2015

    @bajtos
    Member

    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 strongloop/loopback-component-explorer#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".

  7. removed their assignment
    on Apr 14, 2016
  8. supasate commented on Apr 27, 2016

    @supasate
    Contributor

    I have submitted 2 PRs to solve this issue (#2266 and strongloop/loopback-component-explorer#157).

  9. supasate commented on Jul 12, 2016

    @supasate
    Contributor

    @bajtos This issue was solved. You can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions