summaryrefslogtreecommitdiffstats
path: root/server/publications/settings.js
blob: 034737e7c2e3d0b27d4ceff148595b2f10332821 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Meteor.publish('globalwebhooks', () => {
  const boardId = Integrations.Const.GLOBAL_WEBHOOK_ID;
  return Integrations.find({
    boardId,
  });
});
Meteor.publish('setting', () => {
  return Settings.find(
    {},
    {
      fields: {
        disableRegistration: 1,
        productName: 1,
        hideLogo: 1,
        customHTMLafterBodyStart: 1,
        customHTMLbeforeBodyEnd: 1,
        displayAuthenticationMethod: 1,
        defaultAuthenticationMethod: 1,
      },
    },
  );
});

Meteor.publish('mailServer', function() {
  if (!Match.test(this.userId, String)) return [];
  const user = Users.findOne(this.userId);
  if (user && user.isAdmin) {
    return Settings.find({}, { fields: { mailServer: 1 } });
  }
  return [];
});