You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How do I disable relations / remove them from the Explorer? #477
/user/{id}/accessTokens/{fk} routes in the API Explorer. I don't want to expose these. How do I prevent them from being publicly invoked and remove them from the Explorer?
I have a utility class that tries to disable the shared property on every single function in a model, except for those in a whitelist. IMO this should be built-in functionality, on a real webapp you simply cannot expose every single REST function to the public, regardless of ACLs, as they'll still show up in the explorer (and the explorer is a great way to expose documentation).
My tool worked in 1.x, fails in 2.x. It simplify iterates through all properties of the model and looks for the shared property, and sets it to false is present, and the function name is not in the whitelist.
I've since updated it for 2.x by concatenating the methods from {Model}.sharedClass.methods(), but it still fails on relations.
The issue appears to be this line in strong-remoting which creates a new SharedMethod from the internal resolvers array every time methods() is called. No options are passed and it is not possible to set shared.
I've created a corresponding issue in strong-remoting. I believe it may be a large change, otherwise I would submit a PR (you know I like to do that). This is the last thing preventing me from moving my app to Loopback 2.0, so please let me know how I can help.
This issue appears to be resolved at strongloop/strong-remoting#94. Closing. @STRML Please open a new issue if you are still having problems with this.
Activity
STRML commentedon Aug 21, 2014
I have a utility class that tries to disable the
sharedproperty on every single function in a model, except for those in a whitelist. IMO this should be built-in functionality, on a real webapp you simply cannot expose every single REST function to the public, regardless of ACLs, as they'll still show up in the explorer (and the explorer is a great way to expose documentation).My tool worked in 1.x, fails in 2.x. It simplify iterates through all properties of the model and looks for the
sharedproperty, and sets it tofalseis present, and the function name is not in the whitelist.I've since updated it for 2.x by concatenating the methods from
{Model}.sharedClass.methods(), but it still fails on relations.The issue appears to be this line in strong-remoting which creates a new
SharedMethodfrom the internal resolvers array every timemethods()is called. No options are passed and it is not possible to setshared.raymondfeng commentedon Aug 21, 2014
@ritch Can you help?
STRML commentedon Aug 26, 2014
I've created a corresponding issue in strong-remoting. I believe it may be a large change, otherwise I would submit a PR (you know I like to do that). This is the last thing preventing me from moving my app to Loopback 2.0, so please let me know how I can help.
superkhau commentedon Feb 4, 2016
This issue appears to be resolved at strongloop/strong-remoting#94. Closing. @STRML Please open a new issue if you are still having problems with this.