i have model defined persistedmodel, hence related mongodb collection. want achieve following:
- default crud methods hidden
- a custom remote method exposed , mapped on route
get /(whichmymodel.find()default)
so far, couldn't both requirements: if set model public, comes whole set of built-in method mapped on standard routes, if set non-public custom remotes hidden.
the function you're looking is:
mymodel.disableremotemethod(name, [isstatic]) here api docs.
unfortunately, need disable each method individually...
another solution create 2 different models, 1 public , 1 not (your can change public boolean false in server/model-config.json file. not need attach "public" model datasource.
"mypublicmodel": { "datasource": null, "public": true }, "myprivatemodel": { "datasource": "db", "public": false } the public-facing model of base-class model while non-public model still persistedmodel none of endpoints exposed. can access functions of "private" model calling mypublicmodel.app.models.myprivatemodel within mypublicmodel.js file.
(please comment if need clarifications).
Comments
Post a Comment