users.js 602 B

1234567891011121314151617181920212223242526272829
  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({$or: [{_id: match}, {email: match}, {username: match}]}, {
  21. fields: {
  22. '_id': 1,
  23. 'authenticationMethod': 1,
  24. },
  25. });
  26. });