mirror of
https://github.com/wekan/wekan.git
synced 2026-01-25 10:46:09 +01:00
Teams/Organizations to Admin Panel. In Progress.
Thanks to xet7 ! Related #802
This commit is contained in:
parent
b7137e617e
commit
9e2093d6ae
8 changed files with 684 additions and 53 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 [];
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue