@7365admin1/core 3.64.5-staging.298 → 3.64.5-staging.299

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.
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@7365admin1/core": patch
3
+ ---
4
+
5
+ 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.
package/dist/index.js CHANGED
@@ -11769,6 +11769,13 @@ function effectiveSiteModules(orgModules, siteModules) {
11769
11769
  const allowed = site.filter((key) => org.includes(key));
11770
11770
  return allowed.length ? allowed : org;
11771
11771
  }
11772
+ function siteModulesForOrg(site, orgId) {
11773
+ const org = orgId?.toString() ?? "";
11774
+ if (!org)
11775
+ return site?.metadata?.modules;
11776
+ const owner = String(site?.orgId ?? site?.org ?? "");
11777
+ return owner && owner === org ? site?.metadata?.modules : void 0;
11778
+ }
11772
11779
  function rejectedSiteModules(orgModules, requested) {
11773
11780
  if (!narrows(orgModules))
11774
11781
  return [];
@@ -21229,7 +21236,7 @@ async function moduleCeiling(org, site) {
21229
21236
  ]);
21230
21237
  return effectiveSiteModules(
21231
21238
  orgDoc?.modules,
21232
- siteDoc?.metadata?.modules
21239
+ siteModulesForOrg(siteDoc, orgId)
21233
21240
  );
21234
21241
  } catch {
21235
21242
  return [];