mirror of
https://github.com/vale981/Vulcan
synced 2025-03-07 02:21:43 -05:00
21 lines
547 B
JavaScript
21 lines
547 B
JavaScript
// Publish the current user
|
|
|
|
Meteor.publish('currentUser', function() {
|
|
var user = Meteor.users.find({_id: this.userId});
|
|
return user;
|
|
});
|
|
|
|
// publish all users for admins to make autocomplete work
|
|
// TODO: find a better way
|
|
|
|
Meteor.publish('allUsersAdmin', function() {
|
|
var selector = getSetting('requirePostInvite') ? {isInvited: true} : {}; // only users that can post
|
|
if (isAdminById(this.userId)) {
|
|
return Meteor.users.find(selector, {fields: {
|
|
_id: true,
|
|
profile: true,
|
|
slug: true
|
|
}});
|
|
}
|
|
return [];
|
|
});
|