@7365admin1/core 3.65.0 → 3.65.1
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/CHANGELOG.md +6 -0
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/test/site-modules.test.mjs +22 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @iservice365/core
|
|
2
2
|
|
|
3
|
+
## 3.65.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 69714b4: Role writes: a site's own module list narrows a role only when the site belongs to the role's organisation. A service provider's role at a client's site is no longer refused modules the client switched off for that site — matching what the role editor now offers.
|
|
8
|
+
|
|
3
9
|
## 3.65.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/index.js
CHANGED
|
@@ -11758,6 +11758,13 @@ function effectiveSiteModules(orgModules, siteModules) {
|
|
|
11758
11758
|
const allowed = site.filter((key) => org.includes(key));
|
|
11759
11759
|
return allowed.length ? allowed : org;
|
|
11760
11760
|
}
|
|
11761
|
+
function siteModulesForOrg(site, orgId) {
|
|
11762
|
+
const org = orgId?.toString() ?? "";
|
|
11763
|
+
if (!org)
|
|
11764
|
+
return site?.metadata?.modules;
|
|
11765
|
+
const owner = String(site?.orgId ?? site?.org ?? "");
|
|
11766
|
+
return owner && owner === org ? site?.metadata?.modules : void 0;
|
|
11767
|
+
}
|
|
11761
11768
|
function rejectedSiteModules(orgModules, requested) {
|
|
11762
11769
|
if (!narrows(orgModules))
|
|
11763
11770
|
return [];
|
|
@@ -21037,7 +21044,7 @@ async function moduleCeiling(org, site) {
|
|
|
21037
21044
|
]);
|
|
21038
21045
|
return effectiveSiteModules(
|
|
21039
21046
|
orgDoc?.modules,
|
|
21040
|
-
siteDoc
|
|
21047
|
+
siteModulesForOrg(siteDoc, orgId)
|
|
21041
21048
|
);
|
|
21042
21049
|
} catch {
|
|
21043
21050
|
return [];
|