collections.js 368 B

1234567891011121314151617
  1. Images = new Mongo.Collection("images");
  2. // Set up security on images collection.
  3. Images.allow({
  4. insert: function (userId, doc) {
  5. if (userId && userId === doc.createdBy) {
  6. console.log("Image insert allowed for " + userId, doc);
  7. return true;
  8. }
  9. else {
  10. return false;
  11. }
  12. },
  13. remove: function (userId, doc) {
  14. return true;
  15. }
  16. });