Closed artpolikarpov closed 9 years ago
The readme has references to an "underlying" method; Mathieu wrote this in a different answer:
The underlying method is actually
_collection.insert
-- that one is available only on the server and is what I rely on to make sure hooks on the server are only called after allow/deny has had a chance to run.
The package simply wraps the appropriate methods. It's really simple, but finding the exact right method to wrap was the initial challenge.
Pseudo-code-ish example:
function update() {
console.log('hi');
}
var underlying = update;
update = function () {
console.log('do something before');
underlying.apply(this, arguments);
console.log('do something after');
};
Thanks, @matb33!
I’m sorry for my incredulity! Great package. But please explain how it works.
Do you just copy-paste from original Mongo.* methods and add hooks? Or something smarter?
Meteor 1.0.1 contains a patch for a security vulnerability that could cause data loss in apps that use allow/deny rules. Will this package play well with that update or not?
Thank you.