0

How can the client code of a Meteor app detect that a write operation (insert, remove, update) against a collection was denied, so that it can display an appropriate error message?

Collection.remove(id)

The console will display:

remove failed: Access denied

Dan Dascalescu
  • 143,271
  • 52
  • 317
  • 404

1 Answers1

0

This is rather obvious, but Google didn't do a good job of surfacing the relevant documentation: you need to pass a callback parameter:

Collection.remove(id, function (error) {
  if (error)
    sAlert.error(error.toString());
});
Dan Dascalescu
  • 143,271
  • 52
  • 317
  • 404