-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.js
More file actions
executable file
·25 lines (23 loc) · 807 Bytes
/
common.js
File metadata and controls
executable file
·25 lines (23 loc) · 807 Bytes
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
Items = new Meteor.Collection("items");
// allow all permissions if they are in the "Items" group, read only otherwise
Items.allow({
insert: function(userId, petition){
var u = Meteor.users.findOne(userId);
return (u && u.groups && u.groups.indexOf('Items') >= 0);
}
, update: function(userId, petition){
var u = Meteor.users.findOne(userId);
return (u && u.groups && u.groups.indexOf('Items') >= 0);
}
, remove: function(userId, petition){
var u = Meteor.users.findOne(userId);
return (u && u.groups && u.groups.indexOf('Items') >= 0);
}
});
// Partial dataset for client
Pages = new Meteor.Pagination(Items,
{ itemTemplate: 'item'
, perPage: 10
, sort : { date : -1 }
, availableSettings: { filters: true }
});