wekan/server/publications/users.js

32 lines
611 B
JavaScript
Raw Normal View History

Meteor.publish('user-miniprofile', function(userId) {
check(userId, String);
return Users.find(userId, {
fields: {
2019-06-28 12:52:09 -05:00
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);
2019-06-28 12:52:09 -05:00
return Users.find(
{ $or: [{ _id: match }, { email: match }, { username: match }] },
{
fields: {
authenticationMethod: 1,
},
},
2019-06-28 12:52:09 -05:00
);
});