@burtson-labs/bandit-engine 2.0.113 → 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.
package/dist/index.mjs CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  useGatewayHealth,
11
11
  useGatewayMemory,
12
12
  useGatewayModels
13
- } from "./chunk-BLC6ZYGQ.mjs";
13
+ } from "./chunk-H3BUUAHU.mjs";
14
14
  import "./chunk-W2EPDR5G.mjs";
15
15
  import "./chunk-HAUDGBUS.mjs";
16
16
  import "./chunk-BN3D45E2.mjs";
@@ -44229,47 +44229,58 @@ var Management = () => {
44229
44229
  {
44230
44230
  label: "Personalities",
44231
44231
  icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(FaceRetouchingNaturalIcon, {}),
44232
- requiresFeature: "limitedAdminDashboard"
44233
- // Available to premium+
44232
+ requiresFeature: "limitedAdminDashboard",
44233
+ requiresAdmin: true
44234
44234
  },
44235
44235
  {
44236
44236
  label: "Branding",
44237
44237
  icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(BrushIcon, {}),
44238
- requiresFeature: "limitedAdminDashboard"
44239
- // Available to premium+
44238
+ requiresFeature: "limitedAdminDashboard",
44239
+ requiresAdmin: true
44240
44240
  },
44241
44241
  {
44242
44242
  label: "Knowledge",
44243
44243
  icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(MenuBookIcon, {}),
44244
- requiresFeature: "limitedAdminDashboard"
44245
- // Available to premium+
44244
+ requiresFeature: "limitedAdminDashboard",
44245
+ requiresAdmin: true
44246
44246
  },
44247
44247
  {
44248
44248
  label: "Storage",
44249
44249
  icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(StorageIcon, {}),
44250
- requiresFeature: "limitedAdminDashboard"
44251
- // Available to premium+ (changed from adminDashboardEnabled)
44250
+ requiresFeature: "limitedAdminDashboard",
44251
+ requiresAdmin: true
44252
44252
  },
44253
44253
  {
44254
44254
  label: "Preferences",
44255
44255
  icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TuneIcon, {}),
44256
- requiresFeature: "limitedAdminDashboard"
44257
- // Available to premium+
44256
+ requiresFeature: "limitedAdminDashboard",
44257
+ requiresAdmin: false
44258
44258
  },
44259
44259
  {
44260
44260
  label: "Provider",
44261
44261
  icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(CloudIcon, {}),
44262
- requiresFeature: "advancedSearch"
44263
- // Pro/Team users with advanced features
44262
+ requiresFeature: "advancedSearch",
44263
+ requiresAdmin: true
44264
44264
  },
44265
44265
  {
44266
44266
  label: "Tools",
44267
44267
  icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(BuildIcon, {}),
44268
- requiresFeature: "advancedSearch"
44269
- // Pro/Team users with advanced features
44268
+ requiresFeature: "advancedSearch",
44269
+ requiresAdmin: true
44270
44270
  }
44271
44271
  ];
44272
+ const adminRoleNames = /* @__PURE__ */ new Set([
44273
+ "admin",
44274
+ "super-user",
44275
+ "superuser",
44276
+ "super_admin",
44277
+ "platform_admin",
44278
+ "tenant_admin"
44279
+ ]);
44280
+ const userRoles = (authenticationService.parseJwtClaims(authenticationService.getToken() ?? "")?.roles ?? []).map((r) => r.toLowerCase());
44281
+ const isWorkspaceAdmin = userRoles.some((r) => adminRoleNames.has(r) || r.endsWith("-admin"));
44272
44282
  const navTabs = allNavTabs.filter((tab) => {
44283
+ if (tab.requiresAdmin && !isWorkspaceAdmin) return false;
44273
44284
  if (tab.requiresFeature === "limitedAdminDashboard") {
44274
44285
  return hasLimitedAdminDashboard() || hasAdminDashboard();
44275
44286
  }