users.js 586 B

12345678910111213141516171819202122232425262728
  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. 'authenticationMethod': 1,
  23. },
  24. });
  25. });