@burtson-labs/bandit-engine 2.0.112 → 2.0.114

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.
@@ -8565,7 +8565,6 @@ var ProviderTab = () => {
8565
8565
  gatewayUrl: packageSettings?.gatewayApiUrl || "",
8566
8566
  provider: "bandit"
8567
8567
  });
8568
- const [isProviderConfigOpen, setIsProviderConfigOpen] = useState12(false);
8569
8568
  const [snackbarMessage, setSnackbarMessage] = useState12("");
8570
8569
  const [showSnackbar, setShowSnackbar] = useState12(false);
8571
8570
  const [snackbarSeverity, setSnackbarSeverity] = useState12("success");
@@ -8786,7 +8785,7 @@ var ProviderTab = () => {
8786
8785
  ] }) : /* @__PURE__ */ jsx11(Chip8, { label: "No Provider Configured", color: "warning" })
8787
8786
  ] }),
8788
8787
  /* @__PURE__ */ jsxs11(Paper5, { sx: { p: { xs: 1.5, sm: 1.75 }, mb: { xs: 1.5, md: 1.75 }, bgcolor: "background.paper", border: "1px solid", borderColor: "divider", borderRadius: 2 }, children: [
8789
- /* @__PURE__ */ jsxs11(
8788
+ /* @__PURE__ */ jsx11(
8790
8789
  Box11,
8791
8790
  {
8792
8791
  sx: {
@@ -8797,24 +8796,10 @@ var ProviderTab = () => {
8797
8796
  gap: { xs: 1, sm: 2 },
8798
8797
  mb: 2
8799
8798
  },
8800
- children: [
8801
- /* @__PURE__ */ jsx11(Typography10, { variant: "h6", sx: { fontWeight: 600, color: "text.primary" }, children: "Provider Configuration" }),
8802
- /* @__PURE__ */ jsxs11(
8803
- Button9,
8804
- {
8805
- variant: "outlined",
8806
- onClick: () => setIsProviderConfigOpen(!isProviderConfigOpen),
8807
- size: isMobile ? "small" : "medium",
8808
- children: [
8809
- isProviderConfigOpen ? "Hide" : "Configure",
8810
- " Provider"
8811
- ]
8812
- }
8813
- )
8814
- ]
8799
+ children: /* @__PURE__ */ jsx11(Typography10, { variant: "overline", sx: { fontWeight: 700, color: "text.secondary", letterSpacing: 0.6 }, children: "Provider Configuration" })
8815
8800
  }
8816
8801
  ),
8817
- isProviderConfigOpen && /* @__PURE__ */ jsxs11(Box11, { sx: { mt: 3 }, children: [
8802
+ /* @__PURE__ */ jsxs11(Box11, { sx: { mt: 2 }, children: [
8818
8803
  /* @__PURE__ */ jsxs11(
8819
8804
  TextField6,
8820
8805
  {
@@ -10561,47 +10546,58 @@ var Management = () => {
10561
10546
  {
10562
10547
  label: "Personalities",
10563
10548
  icon: /* @__PURE__ */ jsx14(FaceRetouchingNaturalIcon, {}),
10564
- requiresFeature: "limitedAdminDashboard"
10565
- // Available to premium+
10549
+ requiresFeature: "limitedAdminDashboard",
10550
+ requiresAdmin: true
10566
10551
  },
10567
10552
  {
10568
10553
  label: "Branding",
10569
10554
  icon: /* @__PURE__ */ jsx14(BrushIcon, {}),
10570
- requiresFeature: "limitedAdminDashboard"
10571
- // Available to premium+
10555
+ requiresFeature: "limitedAdminDashboard",
10556
+ requiresAdmin: true
10572
10557
  },
10573
10558
  {
10574
10559
  label: "Knowledge",
10575
10560
  icon: /* @__PURE__ */ jsx14(MenuBookIcon, {}),
10576
- requiresFeature: "limitedAdminDashboard"
10577
- // Available to premium+
10561
+ requiresFeature: "limitedAdminDashboard",
10562
+ requiresAdmin: true
10578
10563
  },
10579
10564
  {
10580
10565
  label: "Storage",
10581
10566
  icon: /* @__PURE__ */ jsx14(StorageIcon, {}),
10582
- requiresFeature: "limitedAdminDashboard"
10583
- // Available to premium+ (changed from adminDashboardEnabled)
10567
+ requiresFeature: "limitedAdminDashboard",
10568
+ requiresAdmin: true
10584
10569
  },
10585
10570
  {
10586
10571
  label: "Preferences",
10587
10572
  icon: /* @__PURE__ */ jsx14(TuneIcon, {}),
10588
- requiresFeature: "limitedAdminDashboard"
10589
- // Available to premium+
10573
+ requiresFeature: "limitedAdminDashboard",
10574
+ requiresAdmin: false
10590
10575
  },
10591
10576
  {
10592
10577
  label: "Provider",
10593
10578
  icon: /* @__PURE__ */ jsx14(CloudIcon, {}),
10594
- requiresFeature: "advancedSearch"
10595
- // Pro/Team users with advanced features
10579
+ requiresFeature: "advancedSearch",
10580
+ requiresAdmin: true
10596
10581
  },
10597
10582
  {
10598
10583
  label: "Tools",
10599
10584
  icon: /* @__PURE__ */ jsx14(BuildIcon, {}),
10600
- requiresFeature: "advancedSearch"
10601
- // Pro/Team users with advanced features
10585
+ requiresFeature: "advancedSearch",
10586
+ requiresAdmin: true
10602
10587
  }
10603
10588
  ];
10589
+ const adminRoleNames = /* @__PURE__ */ new Set([
10590
+ "admin",
10591
+ "super-user",
10592
+ "superuser",
10593
+ "super_admin",
10594
+ "platform_admin",
10595
+ "tenant_admin"
10596
+ ]);
10597
+ const userRoles = (authenticationService.parseJwtClaims(authenticationService.getToken() ?? "")?.roles ?? []).map((r) => r.toLowerCase());
10598
+ const isWorkspaceAdmin = userRoles.some((r) => adminRoleNames.has(r) || r.endsWith("-admin"));
10604
10599
  const navTabs = allNavTabs.filter((tab) => {
10600
+ if (tab.requiresAdmin && !isWorkspaceAdmin) return false;
10605
10601
  if (tab.requiresFeature === "limitedAdminDashboard") {
10606
10602
  return hasLimitedAdminDashboard() || hasAdminDashboard();
10607
10603
  }
@@ -11098,4 +11094,4 @@ export {
11098
11094
  useGatewayMemory,
11099
11095
  management_default
11100
11096
  };
11101
- //# sourceMappingURL=chunk-PIBF62UY.mjs.map
11097
+ //# sourceMappingURL=chunk-H3BUUAHU.mjs.map