@easy-cms/plugin-multi-tenant 0.45.0 → 0.46.0
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/index.js +3 -3
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
// src/info.ts
|
|
62
62
|
var INFO = {
|
|
63
63
|
name: "@easy-cms/plugin-multi-tenant",
|
|
64
|
-
...true ? { version: "0.
|
|
64
|
+
...true ? { version: "0.46.0" } : {}
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
// src/members.ts
|
|
@@ -522,11 +522,11 @@ function multiTenantPlugin(options) {
|
|
|
522
522
|
);
|
|
523
523
|
const bound = user?.apiKey?.permissions?.context;
|
|
524
524
|
const boundTenant = bound ? tenantOf(bound) : void 0;
|
|
525
|
-
if (user && isSuper(user) && (!boundTenant || boundTenant.tenant === null)) {
|
|
525
|
+
if (user && user.member !== true && isSuper(user) && (!boundTenant || boundTenant.tenant === null)) {
|
|
526
526
|
const chosen2 = asked === ALL ? void 0 : findTenant(list, asked);
|
|
527
527
|
return { user, context: { ...context, tenant: chosen2?.id ?? null, allTenants: true } };
|
|
528
528
|
}
|
|
529
|
-
if (user) {
|
|
529
|
+
if (user && user.member !== true) {
|
|
530
530
|
const mine = membershipsOf(user);
|
|
531
531
|
const member = (t) => t ? mine.find((m) => sameId(m.tenant, t.id)) : void 0;
|
|
532
532
|
const membership = boundTenant && boundTenant.tenant !== null ? mine.find((m) => sameId(m.tenant, boundTenant.tenant)) ?? (isSuper(user) ? { tenant: boundTenant.tenant, role: user.role } : void 0) : member(findTenant(list, asked)) ?? member(byHost) ?? mine.find((m) => list.some((t) => sameId(t.id, m.tenant)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easy-cms/plugin-multi-tenant",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.0",
|
|
4
4
|
"description": "Multi-tenant Easy CMS: several sites or clients in one CMS, each with its own content, members and roles",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
"dist"
|
|
18
18
|
],
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@easy-cms/core": "^0.
|
|
20
|
+
"@easy-cms/core": "^0.46.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@easy-cms/core": "^0.
|
|
24
|
-
"@easy-cms/db-sqlite": "^0.
|
|
25
|
-
"@easy-cms/plugin-form-builder": "^0.
|
|
26
|
-
"@easy-cms/plugin-nested-docs": "^0.
|
|
27
|
-
"@easy-cms/plugin-redirects": "^0.
|
|
23
|
+
"@easy-cms/core": "^0.46.0",
|
|
24
|
+
"@easy-cms/db-sqlite": "^0.46.0",
|
|
25
|
+
"@easy-cms/plugin-form-builder": "^0.46.0",
|
|
26
|
+
"@easy-cms/plugin-nested-docs": "^0.46.0",
|
|
27
|
+
"@easy-cms/plugin-redirects": "^0.46.0"
|
|
28
28
|
},
|
|
29
29
|
"engines": {
|
|
30
30
|
"node": ">=22.12"
|