Skip to content

Not possible to set shared=false on resolved methods #94

Description

@STRML

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions