Related: StrongLoop: hiding method updateAttributes(), but the accepted answer does not solve my problem.
I have followed the Get Started guide in order to get a basic app setup. In this app, my only model is called Pharmacy, and I would like to hide all mutating functions (i.e. delete, update,create...) from its REST API.
I am following the instructions in the documentation (http://docs.strongloop.com/display/public/LB/Exposing+models+over+REST#ExposingmodelsoverREST-HidingmethodsandRESTendpoints). While I can hide the static functions just fine, the updateAttributes method is still being exposed no matter what I do.
I have placed my hiding logic in common/models/pharmacy.js. Placing it in server/pharmacy.js as indicated by the docs does nothing, as the file is not even loaded.
The content of common/models/pharmacy.js is:
module.exports = function(Pharmacy) {
Pharmacy.sharedClass.find('deleteById', true).shared = false;
Pharmacy.sharedClass.find('updateAttributes', false).shared = false;
Pharmacy.sharedClass.find('upsert', true).shared = false;
Pharmacy.sharedClass.find('create', true).shared = false;
};
What am I doing wrong? Thanks in advance!