mirror of
https://github.com/wekan/wekan.git
synced 2026-01-24 18:26:10 +01:00
Merge branch 'master' of https://github.com/wekan/wekan
This commit is contained in:
commit
223fb78bd8
75 changed files with 34838 additions and 33655 deletions
27
server/publications/org.js
Normal file
27
server/publications/org.js
Normal 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 [];
|
||||
});
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
27
server/publications/team.js
Normal file
27
server/publications/team.js
Normal 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 [];
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue