Blame view

imports/api/documents/documents.js 660 Bytes
f0c912bf1   tmcdeveloper   add method tests ...
1
  import faker from 'faker';
cac7cbc73   tmcdeveloper   4.1.0 release
2
3
4
  import { Mongo } from 'meteor/mongo';
  import { SimpleSchema } from 'meteor/aldeed:simple-schema';
  import { Factory } from 'meteor/dburles:factory';
d1f05315d   tmcdeveloper   wip adding API an...
5

f0c912bf1   tmcdeveloper   add method tests ...
6
  export const Documents = new Mongo.Collection('Documents');
ccf91da0a   tmcdeveloper   add allow/deny ru...
7
8
9
10
11
12
13
14
15
16
17
  Documents.allow({
    insert: () => false,
    update: () => false,
    remove: () => false,
  });
  
  Documents.deny({
    insert: () => true,
    update: () => true,
    remove: () => true,
  });
f0c912bf1   tmcdeveloper   add method tests ...
18
19
20
21
22
23
24
25
26
27
28
29
  Documents.schema = new SimpleSchema({
    title: {
      type: String,
      label: 'The title of the document.',
    },
  });
  
  Documents.attachSchema(Documents.schema);
  
  Factory.define('document', Documents, {
    title: () => faker.hacker.phrase(),
  });