This commit is contained in:
John R. Supplee 2020-12-31 19:15:59 +02:00
commit 223fb78bd8
75 changed files with 34838 additions and 33655 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 [];
});

View file

@ -14,6 +14,7 @@ Meteor.publish('people', function(query, limit) {
fields: {
username: 1,
'profile.fullname': 1,
'profile.initials': 1,
isAdmin: 1,
emails: 1,
createdAt: 1,

View file

@ -0,0 +1,27 @@
Meteor.publish('team', 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 Team.find(query, {
limit,
sort: { createdAt: -1 },
fields: {
displayName: 1,
desc: 1,
name: 1,
website: 1,
teams: 1,
createdAt: 1,
loginDisabled: 1,
},
});
}
return [];
});