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
|
|
|
|
_.each(Settings.simpleSchema._schema, function (property, key) {
|
2015-04-25 12:39:07 +09:00
|
|
|
if (property.private)
|
2015-04-22 07:50:11 +09:00
|
|
|
privateFields[key] = false;
|
|
|
|
});
|
|
|
|
|
|
|
|
if(!Users.isAdminById(this.userId)){
|
|
|
|
options = _.extend(options, {
|
|
|
|
fields: privateFields
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2015-04-25 13:04:10 +09:00
|
|
|
return Settings.find({}, options);
|
2015-04-22 07:50:11 +09:00
|
|
|
});
|