users.js 640 B

1234567891011121314151617181920212223242526272829303132
  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. 'profile.initials': 1,
  9. },
  10. });
  11. });
  12. Meteor.publish('user-admin', function() {
  13. return Meteor.users.find(this.userId, {
  14. fields: {
  15. isAdmin: 1,
  16. },
  17. });
  18. });
  19. Meteor.publish('user-authenticationMethod', function(match) {
  20. check(match, String);
  21. return Users.find(
  22. { $or: [{ _id: match }, { email: match }, { username: match }] },
  23. {
  24. fields: {
  25. authenticationMethod: 1,
  26. },
  27. },
  28. );
  29. });