Steve Steve
Steve Steve

Reputation: 59

Why mongodb .deny() isn't working (Meteor)

The code like this

Cashier.deny({
  insert() { return true; },
  update() { return true; },
  remove() { return true; },
});

do nothing. I can update data from client via mongol. I have tried to write it on server side and in my js file where I made data variables /lib/collections/data.js/ both don't work. Where I have to put it or i miss somethiing

Upvotes: 0

Views: 34

Answers (2)

LastDreamer
LastDreamer

Reputation: 11

Actually Cashier.deny() takes effect, of course if you has deleted "insecure" module. Try to change your collection in browser console:

Cashier.update({ $set: {changed: true}}, {});

You will get 403 error. But you can change you database using Mongol, because it's changes objects in method on server side.

On deploying to production module will be deleted automatically from app.

Upvotes: 1

Areca
Areca

Reputation: 1292

You should remove package 'insecure'. It is added by default.

Upvotes: 0

Related Questions