-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcollections.js
41 lines (37 loc) · 996 Bytes
/
collections.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Students = new Mongo.Collection('students');
Lessons = new Mongo.Collection('lessons');
Scores = new Mongo.Collection('scores');
Classes = new Mongo.Collection('classes');
Students.allow({
insert: function(userId, student){
return student.owner === userId;
},
update: function(userId, student, fields, modifier){
return student.owner === userId;
},
remove: function(userId, student){
return student.owner === userId;
}
});
Lessons.allow({
insert: function(userId, lesson){
return lesson.owner === userId;
},
update: function(userId, lesson, fields, modifier){
return lesson.owner === userId;
},
remove: function(userId, lesson){
return lesson.owner === userId;
}
});
Classes.allow({
insert: function(userId, myclass){
return myclass.owner === userId;
},
update: function(userId, myclass, fields, modifier){
return myclass.owner === userId;
},
remove: function(userId, myclass){
return myclass.owner === userId;
}
});