mirror of
https://github.com/vale981/Vulcan
synced 2025-03-07 02:21:43 -05:00
17 lines
450 B
JavaScript
17 lines
450 B
JavaScript
![]() |
Meteor.publish('settings', function() {
|
||
|
var options = {};
|
||
|
var privateFields = {};
|
||
|
|
||
|
// look at SettingsSchema to see which fields should be kept private
|
||
|
_.each(SettingsSchema._schema, function( val, key ) {
|
||
|
if (val.autoform && !!val.autoform.private)
|
||
|
privateFields[key] = false;
|
||
|
});
|
||
|
|
||
|
if(!isAdminById(this.userId)){
|
||
|
options = _.extend(options, {
|
||
|
fields: privateFields
|
||
|
});
|
||
|
}
|
||
|
return Settings.find({}, options);
|
||
|
});
|