Hi Everyone,
Quick organizational question.
In which file & folder should I publish all my users so that I can access them in an admin page?
Should it be imports/api/users/server/publications.js ?
Hi Everyone,
Quick organizational question.
In which file & folder should I publish all my users so that I can access them in an admin page?
Should it be imports/api/users/server/publications.js ?
Just write a secured publication
Meteor.publish('adminUsers', function() {
// Check if the user is an admin (use your role system or something else)
if (isAdmin(this.userId) {
return Users.find();
} else {
return [];
}
});
and yes, this can be in the file you mentioned.
Awesome, thanks a lot!