users.js 611 B

12345678910111213141516171819202122232425262728293031
  1. Meteor.publish('user-miniprofile', function(userId) {
  2. check(userId, String);
  3. return Users.find(userId, {
  4. fields: {
  5. username: 1,
  6. 'profile.fullname': 1,
  7. 'profile.avatarUrl': 1,
  8. },
  9. });
  10. });
  11. Meteor.publish('user-admin', function() {
  12. return Meteor.users.find(this.userId, {
  13. fields: {
  14. isAdmin: 1,
  15. },
  16. });
  17. });
  18. Meteor.publish('user-authenticationMethod', function(match) {
  19. check(match, String);
  20. return Users.find(
  21. { $or: [{ _id: match }, { email: match }, { username: match }] },
  22. {
  23. fields: {
  24. authenticationMethod: 1,
  25. },
  26. },
  27. );
  28. });