Skip to content

Commit

Permalink
Add Meteor security patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Gorbachev authored and Denis Gorbachev committed Dec 10, 2014
1 parent 5189765 commit f0a5ca1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions server/meteor-security-patch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(function () {
// Remove this code after updating to Meteor 1.0.1.
var c = typeof Mongo === "undefined" ?
Meteor.Collection : Mongo.Collection;
var proto = c.prototype;
var orig = proto._validatedUpdate;
proto._validatedUpdate = function (userId, selector, mutator) {
check(mutator, Object);
if (_.isEmpty(mutator)) {
throw new Meteor.Error(403, "Access denied.");
}
return orig.apply(this, arguments);
};
})();

0 comments on commit f0a5ca1

Please sign in to comment.