@openinc/parse-server-opendash 2.3.1 → 2.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/config.js CHANGED
@@ -11,6 +11,57 @@ const options = {
11
11
  public: true,
12
12
  description: "...",
13
13
  },
14
+ APP_TITLE: {
15
+ env: "OPENINC_PARSE_APP_TITLE",
16
+ type: "string",
17
+ required: false,
18
+ secret: false,
19
+ public: true,
20
+ default: "open.DASH",
21
+ description: "...",
22
+ },
23
+ APP_COPYRIGHT_TEXT: {
24
+ env: "OPENINC_PARSE_APP_COPYRIGHT_TEXT",
25
+ type: "string",
26
+ required: false,
27
+ secret: false,
28
+ public: true,
29
+ default: "Powered by open.INC",
30
+ description: "...",
31
+ },
32
+ APP_COPYRIGHT_LINK: {
33
+ env: "OPENINC_PARSE_APP_COPYRIGHT_LINK",
34
+ type: "string",
35
+ required: false,
36
+ secret: false,
37
+ public: true,
38
+ default: "https://openinc.de/",
39
+ description: "...",
40
+ },
41
+ APP_IMPRINT_URL: {
42
+ env: "OPENINC_PARSE_APP_IMPRINT_URL",
43
+ type: "string",
44
+ required: false,
45
+ secret: false,
46
+ public: true,
47
+ description: "...",
48
+ },
49
+ APP_DATA_PROTECTION_URL: {
50
+ env: "OPENINC_PARSE_APP_DATA_PROTECTION_URL",
51
+ type: "string",
52
+ required: false,
53
+ secret: false,
54
+ public: true,
55
+ description: "...",
56
+ },
57
+ APP_TOS_URL: {
58
+ env: "OPENINC_PARSE_APP_TOS_URL",
59
+ type: "string",
60
+ required: false,
61
+ secret: false,
62
+ public: true,
63
+ description: "...",
64
+ },
14
65
  APP_NOTIFICATIONS_PER_EMAIL: {
15
66
  env: "OPENINC_PARSE_APP_NOTIFICATIONS_PER_EMAIL",
16
67
  type: "boolean",
@@ -27,6 +27,10 @@ async function init() {
27
27
  }
28
28
  }
29
29
  }
30
+ user.set("tenantGlobal", !!tenant && !!user.get("tenantGlobal"));
31
+ if (tenant && request.original?.get("tenant")?.id !== tenant?.id) {
32
+ user.set("tenantGlobal", !!tenant.get("interactWithOtherTenants"));
33
+ }
30
34
  user.set("tenantAdmin", !!user.get("tenantVerified") && !!user.get("tenantAdmin"));
31
35
  user.set("tenantChanged", !!user.get("tenantChanged"));
32
36
  if (user.get("tenantChanged")) {
@@ -50,6 +54,9 @@ async function init() {
50
54
  [`role:od-tenant-user-${tenantId}`]: { read: true },
51
55
  [`role:od-tenant-admin-${tenantId}`]: { read: true, write: true },
52
56
  }),
57
+ ...(user.get("tenantGlobal") && {
58
+ "role:od-tenant-global-visible": { read: true },
59
+ }),
53
60
  ...(user.id && {
54
61
  [user.id]: { read: true },
55
62
  }),
@@ -76,6 +83,7 @@ async function init() {
76
83
  const wasAdmin = !!original?.get("tenantAdmin");
77
84
  const isVerified = isTenant && !!object.get("tenantVerified");
78
85
  const wasVerified = wasTenant && !!object.get("tenantVerified");
86
+ const isGlobal = isVerified && !!object.get("tenantGlobal");
79
87
  const changedTenant = isTenant !== wasTenant || tenantId !== prevTenantId;
80
88
  const changedAdmin = isAdmin !== wasAdmin;
81
89
  const changedVerified = isVerified !== wasVerified;
@@ -85,6 +93,7 @@ async function init() {
85
93
  await (0, __1.ensureUserRole)(object, `od-tenant-user`, isTenant);
86
94
  await (0, __1.ensureUserRole)(object, `od-tenant-verified`, isVerified);
87
95
  await (0, __1.ensureUserRole)(object, `od-tenant-admin`, isAdmin);
96
+ await (0, __1.ensureUserRole)(object, `od-tenant-global-visible`, isGlobal);
88
97
  if (tenantId) {
89
98
  await (0, __1.ensureUserRole)(object, `od-tenant-user-${tenantId}`, true);
90
99
  await (0, __1.ensureUserRole)(object, `od-tenant-admin-${tenantId}`, isAdmin);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openinc/parse-server-opendash",
3
- "version": "2.3.1",
3
+ "version": "2.3.3",
4
4
  "description": "Parse Server Cloud Code for open.DASH",
5
5
  "keywords": [
6
6
  "parse",