diff --git a/client/main.js b/client/main.js index 05b65c082..8d81c63fb 100644 --- a/client/main.js +++ b/client/main.js @@ -28,8 +28,8 @@ Meteor.subscribe('categories'); // Meteor doesn't send all the user properties that we need Meteor.subscribe('currentUser'); -// Subscribe to all users for now to make user selection autocomplete work? -// Meteor.subscribe('allUsers', {}, {}); +// Subscribe to all users for now to make user selection autocomplete work +Meteor.subscribe('allUsersAdmin'); // Notifications - only load if user is logged in if(Meteor.user() != null) diff --git a/server/publications.js b/server/publications.js index 4318a3245..cdb356f47 100644 --- a/server/publications.js +++ b/server/publications.js @@ -77,6 +77,14 @@ Meteor.publish('allUsers', function(find, options) { } }); +// publish all users for admins to make autocomplete work +// TODO: find a better way + +Meteor.publish('allUsersAdmin', function() { + if (isAdminById(this.userId)) + return Meteor.users.find(); +}); + // -------------------------------------------- Posts -------------------------------------------- // // Publish a single post