This is related to strongloop/loopback#477.
This line makes it impossible to disable relation REST methods, as new SharedMethods are created each time ModelClass.methods() is called, ensuring that all relation methods will have shared=true.
Ideally, the shared property would be removed or be moved to a getter, and methods() would check a user-provided whitelist (default: all methods). The current recommendation of using ModelClass.sharedClass.find(fn, isShared).shared = false is not only leaky but not guaranteed to work.
This is related to strongloop/loopback#477.
This line makes it impossible to disable relation REST methods, as new SharedMethods are created each time
ModelClass.methods()is called, ensuring that all relation methods will haveshared=true.Ideally, the
sharedproperty would be removed or be moved to a getter, andmethods()would check a user-provided whitelist (default: all methods). The current recommendation of usingModelClass.sharedClass.find(fn, isShared).shared = falseis not only leaky but not guaranteed to work.