summaryrefslogtreecommitdiffstats
path: root/server/publications/users.js
blob: 136e1e08fbbc28fe9663bbd8b0c232cfae5a334b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Meteor.publish('user-miniprofile', function(userId) {
  check(userId, String);

  return Users.find(userId, {
    fields: {
      'username': 1,
      'profile.fullname': 1,
      'profile.avatarUrl': 1,
    },
  });
});

Meteor.publish('user-admin', function() {
  return Meteor.users.find(this.userId, {
    fields: {
      isAdmin: 1,
    },
  });
});

Meteor.publish('user-authenticationMethod', function(match) {
  check(match, String);
  return Users.find({$or: [{_id: match}, {email: match}, {username: match}]}, {
    fields: {
      '_id': 1,
      'authenticationMethod': 1,
    },
  });
});