diff --git a/lib/collections/locations.js b/lib/collections/locations.js index f3fd10b..196dc16 100644 --- a/lib/collections/locations.js +++ b/lib/collections/locations.js @@ -111,14 +111,34 @@ locationSchemaObject = { } }; +// Setup global namespace Locations = new Mongo.Collection('locations'); locationSchema = new SimpleSchema(locationSchemaObject); Locations.attachSchema(locationSchema); +// Posts config namespace +Locations.config = {}; +Locations.config.locationStatuses = [ + { + value: 1, + label: function(){return 'pending';} + }, + { + value: 2, + label: function(){return 'approved';} + }, + { + value: 3, + label: function(){return 'rejected';} + } +]; + +// Define allow callback. Locations.allow({ remove: function(userId, location) { return (isAdminUser()); }, }); +// Server side methods. Meteor.methods({ locationInsert: function(locationAttributes) { var locationWithSameLink = Locations.findOne({url: locationAttributes.url});