@easy-cms/plugin-multi-tenant 0.45.0 → 0.47.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 +5 -5
- 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.47.0" } : {}
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
// src/members.ts
|
|
@@ -417,7 +417,7 @@ function multiTenantPlugin(options) {
|
|
|
417
417
|
icon: "building",
|
|
418
418
|
useAsTitle: "name",
|
|
419
419
|
admin: {
|
|
420
|
-
group: "settings",
|
|
420
|
+
group: "settings.people",
|
|
421
421
|
// Deleting a tenant deletes its content: its name is typed, and what goes is shown.
|
|
422
422
|
confirmDelete: { typeTitle: true, impact: "/tenant-impact" }
|
|
423
423
|
},
|
|
@@ -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)));
|
|
@@ -686,7 +686,7 @@ of its own. Run it once after adding the plugin to a site that has content.
|
|
|
686
686
|
path: "tenant-members",
|
|
687
687
|
label: { en: "Members", th: "\u0E2A\u0E21\u0E32\u0E0A\u0E34\u0E01" },
|
|
688
688
|
icon: "users",
|
|
689
|
-
group: "settings",
|
|
689
|
+
group: "settings.people",
|
|
690
690
|
// Admins of a tenant (and users with access to all, once they choose one).
|
|
691
691
|
access: ({ user }) => user.role === "admin",
|
|
692
692
|
component: { tag: "ecms-tenant-members" }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easy-cms/plugin-multi-tenant",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.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.47.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@easy-cms/
|
|
24
|
-
"@easy-cms/
|
|
25
|
-
"@easy-cms/plugin-form-builder": "^0.
|
|
26
|
-
"@easy-cms/plugin-
|
|
27
|
-
"@easy-cms/
|
|
23
|
+
"@easy-cms/db-sqlite": "^0.47.0",
|
|
24
|
+
"@easy-cms/plugin-nested-docs": "^0.47.0",
|
|
25
|
+
"@easy-cms/plugin-form-builder": "^0.47.0",
|
|
26
|
+
"@easy-cms/plugin-redirects": "^0.47.0",
|
|
27
|
+
"@easy-cms/core": "^0.47.0"
|
|
28
28
|
},
|
|
29
29
|
"engines": {
|
|
30
30
|
"node": ">=22.12"
|