From da253a8ea83f5108a8df7c538130120397e4548f Mon Sep 17 00:00:00 2001 From: yamanq Date: Sun, 1 Feb 2015 23:19:54 -0500 Subject: [PATCH] added security and fixed bugs in previous push --- chromebook-checkout-meteor/collections/carts.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/chromebook-checkout-meteor/collections/carts.js b/chromebook-checkout-meteor/collections/carts.js index bbeca1d..b4d6c32 100644 --- a/chromebook-checkout-meteor/collections/carts.js +++ b/chromebook-checkout-meteor/collections/carts.js @@ -1 +1,9 @@ -carts = new Mongo.Collection("carts"); \ No newline at end of file +carts = new Mongo.Collection("carts"); +carts.allow({ + insert: function (userId, doc) { + return Roles.userIsInRole(Meteor.user()._id, ['admin']); + }, + remove: function (userId, doc) { + return Roles.userIsInRole(Meteor.user()._id, ['admin']); + } +}); \ No newline at end of file