Teams/Organizations to Admin Panel. In Progress.

Thanks to xet7 !

Related #802
This commit is contained in:
Lauri Ojansivu 2020-12-28 21:08:27 +02:00
parent b7137e617e
commit 9e2093d6ae
8 changed files with 684 additions and 53 deletions

View file

@ -0,0 +1,27 @@
Meteor.publish('org', function(query, limit) {
check(query, Match.OneOf(Object, null));
check(limit, Number);
if (!Match.test(this.userId, String)) {
return [];
}
const user = Users.findOne(this.userId);
if (user && user.isAdmin) {
return Org.find(query, {
limit,
sort: { createdAt: -1 },
fields: {
displayName: 1,
desc: 1,
name: 1,
website: 1,
teams: 1,
createdAt: 1,
loginDisabled: 1,
},
});
}
return [];
});