2015-04-22 07:50:11 +09:00
|
|
|
Meteor.publish('settings', function() {
|
|
|
|
var options = {};
|
|
|
|
var privateFields = {};
|
|
|
|
|
2015-04-25 13:20:51 +09:00
|
|
|
// look at Settings.simpleSchema._schema to see which fields should be kept private
|
2016-02-16 15:40:37 +09:00
|
|
|
_.each(Telescope.settings.collection.simpleSchema()._schema, (property, key) => {
|
2015-06-17 18:21:23 +09:00
|
|
|
if (property.private)
|
2015-04-22 07:50:11 +09:00
|
|
|
privateFields[key] = false;
|
|
|
|
});
|
|
|
|
|
2016-02-16 15:40:37 +09:00
|
|
|
options = _.extend(options, {
|
|
|
|
fields: privateFields
|
|
|
|
});
|
2015-04-22 07:50:11 +09:00
|
|
|
|
2016-02-16 15:08:30 +09:00
|
|
|
return Telescope.settings.collection.find({}, options);
|
2015-04-22 07:50:11 +09:00
|
|
|
});
|