I can not replace the repetition of the code (which commented out).
module.exports = function(Product) { /*Product.disableRemoteMethod('createChangeStream', true); Product.disableRemoteMethod('upsert', true); Product.disableRemoteMethod('upsert', true); Product.disableRemoteMethod('updateAll', true); Product.disableRemoteMethod('replaceOrCreate', true); Product.disableRemoteMethod('replaceById', true); Product.disableRemoteMethod('exists', true); Product.disableRemoteMethod('count', true); Product.disableRemoteMethod('findOne', true);*/ var array = ['createChangeStream', 'upsert', 'updateAll', 'replaceOrCreate', 'replaceById', 'exists', 'count', 'findOne']; array.forEach(function(item, i, array) { Product.disableRemoteMethod( i + item + array ); }); }; 
itemandtruetransfer, and not add it toiandarray- GrundyProduct.disableRemoteMethod(item, true);- Igor