From 889a8a2882e46b475ec3ad4d67db2aa176e016b0 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 4 Jul 2022 12:51:38 +0100 Subject: [PATCH] filter out non-admins in intercom --- .../builder/src/analytics/IntercomClient.js | 2 +- packages/builder/src/stores/portal/auth.js | 2 ++ packages/server/yarn.lock | 18 +++++++++--------- packages/worker/yarn.lock | 18 +++++++++--------- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/packages/builder/src/analytics/IntercomClient.js b/packages/builder/src/analytics/IntercomClient.js index d4835d979d..251d2d2e1a 100644 --- a/packages/builder/src/analytics/IntercomClient.js +++ b/packages/builder/src/analytics/IntercomClient.js @@ -53,7 +53,7 @@ export default class IntercomClient { * @returns Intercom global object */ show(user = {}) { - if (!this.initialised) return + if (!this.initialised || !user?.admin?.global) return return window.Intercom("boot", { app_id: this.token, diff --git a/packages/builder/src/stores/portal/auth.js b/packages/builder/src/stores/portal/auth.js index ed09b21c87..5e8b28f6e7 100644 --- a/packages/builder/src/stores/portal/auth.js +++ b/packages/builder/src/stores/portal/auth.js @@ -64,6 +64,8 @@ export function createAuthStore() { name: user.account?.name, user_id: user._id, tenant: user.tenantId, + admin: user?.admin?.global, + builder: user?.builder?.global, "Company size": user.account?.size, "Job role": user.account?.profession, }) diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 7dd2021116..f6816aa880 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1028,10 +1028,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.0.213": - version "1.0.213" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.213.tgz#da10d014b5e39457413a9b7f6ead54322d482855" - integrity sha512-ARqPhrev/da9WNXVIYSXN5M+cYLKSBYL7pvVVcwMXewp6KCR0gdUBHxuksnrmTbxqT43h7Uc/Zg1H/jYc1xQQQ== +"@budibase/backend-core@1.0.216": + version "1.0.216" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.216.tgz#f97caefffcc5b5bfa23740178b3f7efc945ef226" + integrity sha512-mGbevDtnyCJu/M1U3mnu8Ynxx0hMAlZg1RUX71eizvENuBRWFA7mEXlN0ay1uC0xiROllJCWI0zucYXkTxuu0w== dependencies: "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1109,12 +1109,12 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.0.213": - version "1.0.213" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.213.tgz#80e6005bec51927d373d278dd8d8672c2f25a4d5" - integrity sha512-zhTMPZBv0IkQsdKz1ywnWaxmt/PMrw/EkW1dS8bIOAqHgFTUgawiMGrqrzH43Iw3JemMK7AvtI1EOhs+zrMWVg== +"@budibase/pro@1.0.216": + version "1.0.216" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.216.tgz#bf4b2851d8bff3ada05deb0ec3e2ae3eadf998a2" + integrity sha512-YL9fpZCMBrwpJEk86slwegGEtrX2isW77E2A0Z9ZPKQehghdEBcOp2HIZJPhKXmo0TePbW8SHblC8LnrSbaMdg== dependencies: - "@budibase/backend-core" "1.0.213" + "@budibase/backend-core" "1.0.216" node-fetch "^2.6.1" "@budibase/standard-components@^0.9.139": diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 4c394647a7..5c14652012 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,10 +291,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.0.213": - version "1.0.213" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.213.tgz#da10d014b5e39457413a9b7f6ead54322d482855" - integrity sha512-ARqPhrev/da9WNXVIYSXN5M+cYLKSBYL7pvVVcwMXewp6KCR0gdUBHxuksnrmTbxqT43h7Uc/Zg1H/jYc1xQQQ== +"@budibase/backend-core@1.0.216": + version "1.0.216" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.216.tgz#f97caefffcc5b5bfa23740178b3f7efc945ef226" + integrity sha512-mGbevDtnyCJu/M1U3mnu8Ynxx0hMAlZg1RUX71eizvENuBRWFA7mEXlN0ay1uC0xiROllJCWI0zucYXkTxuu0w== dependencies: "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -322,12 +322,12 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@1.0.213": - version "1.0.213" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.213.tgz#80e6005bec51927d373d278dd8d8672c2f25a4d5" - integrity sha512-zhTMPZBv0IkQsdKz1ywnWaxmt/PMrw/EkW1dS8bIOAqHgFTUgawiMGrqrzH43Iw3JemMK7AvtI1EOhs+zrMWVg== +"@budibase/pro@1.0.216": + version "1.0.216" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.216.tgz#bf4b2851d8bff3ada05deb0ec3e2ae3eadf998a2" + integrity sha512-YL9fpZCMBrwpJEk86slwegGEtrX2isW77E2A0Z9ZPKQehghdEBcOp2HIZJPhKXmo0TePbW8SHblC8LnrSbaMdg== dependencies: - "@budibase/backend-core" "1.0.213" + "@budibase/backend-core" "1.0.216" node-fetch "^2.6.1" "@cspotcode/source-map-consumer@0.8.0":