diff --git a/chromebook-checkout-meteor/collections/carts.js b/chromebook-checkout-meteor/collections/carts.js index b4d6c32..0d854b2 100644 --- a/chromebook-checkout-meteor/collections/carts.js +++ b/chromebook-checkout-meteor/collections/carts.js @@ -1,9 +1,11 @@ carts = new Mongo.Collection("carts"); carts.allow({ insert: function (userId, doc) { - return Roles.userIsInRole(Meteor.user()._id, ['admin']); + return Roles.userIsInRole(userId, ['admin']); }, + update: userId, remove: function (userId, doc) { - return Roles.userIsInRole(Meteor.user()._id, ['admin']); - } + return Roles.userIsInRole(userId, ['admin']); + }, + fetch: userId }); \ No newline at end of file diff --git a/chromebook-checkout-meteor/collections/chromebooks.js b/chromebook-checkout-meteor/collections/chromebooks.js index 6734736..f3af65e 100644 --- a/chromebook-checkout-meteor/collections/chromebooks.js +++ b/chromebook-checkout-meteor/collections/chromebooks.js @@ -1,9 +1,11 @@ Chromebooks = new Mongo.Collection("chromebook"); Chromebooks.allow({ insert: function (userId, doc) { - return Roles.userIsInRole(Meteor.user()._id, ['admin']); + return Roles.userIsInRole(userId, ['admin']); }, + update: userId, remove: function (userId, doc) { - return Roles.userIsInRole(Meteor.user()._id, ['admin']); - } + return Roles.userIsInRole(userId, ['admin']); + }, + fetch: userId }); \ No newline at end of file