@jmruthers/pace-core 0.5.169 → 0.5.171
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/{chunk-D2BVDX3I.js → chunk-R22KYCHR.js} +63 -16
- package/dist/chunk-R22KYCHR.js.map +1 -0
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/docs/api/classes/ColumnFactory.md +1 -1
- package/docs/api/classes/ErrorBoundary.md +1 -1
- package/docs/api/classes/InvalidScopeError.md +1 -1
- package/docs/api/classes/MissingUserContextError.md +1 -1
- package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
- package/docs/api/classes/PermissionDeniedError.md +1 -1
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +1 -1
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +1 -1
- package/docs/api/classes/RBACError.md +1 -1
- package/docs/api/classes/RBACNotInitializedError.md +1 -1
- package/docs/api/classes/SecureSupabaseClient.md +1 -1
- package/docs/api/classes/StorageUtils.md +1 -1
- package/docs/api/enums/FileCategory.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +1 -1
- package/docs/api/interfaces/BadgeProps.md +1 -1
- package/docs/api/interfaces/ButtonProps.md +1 -1
- package/docs/api/interfaces/CalendarProps.md +1 -1
- package/docs/api/interfaces/CardProps.md +1 -1
- package/docs/api/interfaces/ColorPalette.md +1 -1
- package/docs/api/interfaces/ColorShade.md +1 -1
- package/docs/api/interfaces/DataAccessRecord.md +1 -1
- package/docs/api/interfaces/DataRecord.md +1 -1
- package/docs/api/interfaces/DataTableAction.md +1 -1
- package/docs/api/interfaces/DataTableColumn.md +1 -1
- package/docs/api/interfaces/DataTableProps.md +1 -1
- package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
- package/docs/api/interfaces/EmptyStateConfig.md +1 -1
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/EventAppRoleData.md +1 -1
- package/docs/api/interfaces/EventLogoProps.md +1 -1
- package/docs/api/interfaces/ExportColumn.md +1 -1
- package/docs/api/interfaces/ExportOptions.md +1 -1
- package/docs/api/interfaces/FileDisplayProps.md +1 -1
- package/docs/api/interfaces/FileMetadata.md +1 -1
- package/docs/api/interfaces/FileReference.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadOptions.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.md +1 -1
- package/docs/api/interfaces/GrantEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
- package/docs/api/interfaces/InputProps.md +1 -1
- package/docs/api/interfaces/LabelProps.md +1 -1
- package/docs/api/interfaces/LoginFormProps.md +1 -1
- package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
- package/docs/api/interfaces/NavigationContextType.md +1 -1
- package/docs/api/interfaces/NavigationGuardProps.md +1 -1
- package/docs/api/interfaces/NavigationItem.md +1 -1
- package/docs/api/interfaces/NavigationMenuProps.md +1 -1
- package/docs/api/interfaces/NavigationProviderProps.md +1 -1
- package/docs/api/interfaces/Organisation.md +1 -1
- package/docs/api/interfaces/OrganisationContextType.md +1 -1
- package/docs/api/interfaces/OrganisationMembership.md +1 -1
- package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
- package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
- package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
- package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
- package/docs/api/interfaces/PageAccessRecord.md +1 -1
- package/docs/api/interfaces/PagePermissionContextType.md +1 -1
- package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
- package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
- package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
- package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
- package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
- package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/ResourcePermissions.md +1 -1
- package/docs/api/interfaces/RevokeEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
- package/docs/api/interfaces/RoleManagementResult.md +1 -1
- package/docs/api/interfaces/RouteAccessRecord.md +1 -1
- package/docs/api/interfaces/RouteConfig.md +1 -1
- package/docs/api/interfaces/SecureDataContextType.md +1 -1
- package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
- package/docs/api/interfaces/SessionRestorationLoaderProps.md +1 -1
- package/docs/api/interfaces/StorageConfig.md +1 -1
- package/docs/api/interfaces/StorageFileInfo.md +1 -1
- package/docs/api/interfaces/StorageFileMetadata.md +1 -1
- package/docs/api/interfaces/StorageListOptions.md +1 -1
- package/docs/api/interfaces/StorageListResult.md +1 -1
- package/docs/api/interfaces/StorageUploadOptions.md +1 -1
- package/docs/api/interfaces/StorageUploadResult.md +1 -1
- package/docs/api/interfaces/StorageUrlOptions.md +1 -1
- package/docs/api/interfaces/StyleImport.md +1 -1
- package/docs/api/interfaces/SwitchProps.md +1 -1
- package/docs/api/interfaces/TabsContentProps.md +1 -1
- package/docs/api/interfaces/TabsListProps.md +1 -1
- package/docs/api/interfaces/TabsProps.md +1 -1
- package/docs/api/interfaces/TabsTriggerProps.md +1 -1
- package/docs/api/interfaces/TextareaProps.md +1 -1
- package/docs/api/interfaces/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayOptions.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
- package/docs/api/interfaces/UseResourcePermissionsOptions.md +1 -1
- package/docs/api/interfaces/UserEventAccess.md +1 -1
- package/docs/api/interfaces/UserMenuProps.md +1 -1
- package/docs/api/interfaces/UserProfile.md +1 -1
- package/docs/api/modules.md +2 -2
- package/package.json +1 -1
- package/src/components/NavigationMenu/NavigationMenu.tsx +65 -14
- package/dist/chunk-D2BVDX3I.js.map +0 -1
package/docs/api/modules.md
CHANGED
package/package.json
CHANGED
|
@@ -627,6 +627,16 @@ export const NavigationMenu = React.forwardRef<
|
|
|
627
627
|
const previousFilteredItemsRef = React.useRef<NavigationItem[]>([]);
|
|
628
628
|
|
|
629
629
|
const filteredItems = React.useMemo(() => {
|
|
630
|
+
logger.warn('NavigationMenu', 'filteredItems useMemo running', {
|
|
631
|
+
filterByPermissions,
|
|
632
|
+
hasAuthContext: !!authContext,
|
|
633
|
+
hasRbacContext: !!rbacContext,
|
|
634
|
+
permissionsLoading,
|
|
635
|
+
permissionMapSize: permissionMap ? Object.keys(permissionMap).length : 0,
|
|
636
|
+
permissionsError: permissionsError?.message,
|
|
637
|
+
itemsCount: items?.length || 0
|
|
638
|
+
});
|
|
639
|
+
|
|
630
640
|
// Security: If filtering is enabled but we're missing required context or still loading, show NO items
|
|
631
641
|
// This prevents security risk of showing items before permissions are verified
|
|
632
642
|
if (filterByPermissions) {
|
|
@@ -705,7 +715,16 @@ export const NavigationMenu = React.forwardRef<
|
|
|
705
715
|
|
|
706
716
|
if (permissions.length > 0) {
|
|
707
717
|
const hasPermission = hasAnyPermission(permissions);
|
|
708
|
-
if (!hasPermission)
|
|
718
|
+
if (!hasPermission) {
|
|
719
|
+
logger.warn('NavigationMenu', `Filtering out navigation item "${item.label}" - no explicit permission:`, {
|
|
720
|
+
itemId: item.id,
|
|
721
|
+
href: item.href,
|
|
722
|
+
requiredPermissions: permissions,
|
|
723
|
+
hasPermission,
|
|
724
|
+
permissionMapKeys: Object.keys(permissionMap).slice(0, 20)
|
|
725
|
+
});
|
|
726
|
+
return false;
|
|
727
|
+
}
|
|
709
728
|
}
|
|
710
729
|
}
|
|
711
730
|
|
|
@@ -735,7 +754,18 @@ export const NavigationMenu = React.forwardRef<
|
|
|
735
754
|
);
|
|
736
755
|
}
|
|
737
756
|
});
|
|
738
|
-
if (!hasRole)
|
|
757
|
+
if (!hasRole) {
|
|
758
|
+
logger.warn('NavigationMenu', `Filtering out navigation item "${item.label}" - no required role:`, {
|
|
759
|
+
itemId: item.id,
|
|
760
|
+
href: item.href,
|
|
761
|
+
requiredRoles: item.roles,
|
|
762
|
+
hasRole,
|
|
763
|
+
organisationRole: rbacContext.organisationRole,
|
|
764
|
+
eventAppRole: rbacContext.eventAppRole,
|
|
765
|
+
isSuperAdmin: rbacContext.isSuperAdmin
|
|
766
|
+
});
|
|
767
|
+
return false;
|
|
768
|
+
}
|
|
739
769
|
}
|
|
740
770
|
|
|
741
771
|
// Check access level if available
|
|
@@ -771,6 +801,13 @@ export const NavigationMenu = React.forwardRef<
|
|
|
771
801
|
const userLevel = userAccessLevel ? levelHierarchy[userAccessLevel] || 0 : 0;
|
|
772
802
|
|
|
773
803
|
if (userLevel < requiredLevel) {
|
|
804
|
+
logger.warn('NavigationMenu', `Filtering out navigation item "${item.label}" - insufficient access level:`, {
|
|
805
|
+
itemId: item.id,
|
|
806
|
+
href: item.href,
|
|
807
|
+
requiredAccessLevel: item.accessLevel,
|
|
808
|
+
userAccessLevel: userAccessLevel,
|
|
809
|
+
userEventRole: rbacContext.eventAppRole
|
|
810
|
+
});
|
|
774
811
|
return false;
|
|
775
812
|
}
|
|
776
813
|
}
|
|
@@ -793,23 +830,31 @@ export const NavigationMenu = React.forwardRef<
|
|
|
793
830
|
const finalHasPermission = isSuperAdmin || hasPagePermission;
|
|
794
831
|
|
|
795
832
|
if (!finalHasPermission) {
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
});
|
|
807
|
-
}
|
|
833
|
+
logger.warn('NavigationMenu', `Filtering out navigation item "${item.label}" - no page permission:`, {
|
|
834
|
+
itemId: item.id,
|
|
835
|
+
href: item.href,
|
|
836
|
+
pageId,
|
|
837
|
+
permission: pagePermission,
|
|
838
|
+
hasPermission: finalHasPermission,
|
|
839
|
+
isSuperAdmin,
|
|
840
|
+
permissionMapValue: permissionMap[pagePermission],
|
|
841
|
+
permissionMapKeys: Object.keys(permissionMap).slice(0, 20) // Show first 20 keys for debugging
|
|
842
|
+
});
|
|
808
843
|
return false;
|
|
809
844
|
}
|
|
810
845
|
}
|
|
811
846
|
}
|
|
812
847
|
|
|
848
|
+
// Item passed all checks - log for debugging
|
|
849
|
+
logger.debug('NavigationMenu', `Navigation item "${item.label}" passed all permission checks`, {
|
|
850
|
+
itemId: item.id,
|
|
851
|
+
href: item.href,
|
|
852
|
+
hasPermissions: !!(item.permissions && item.permissions.length > 0),
|
|
853
|
+
hasRoles: !!(item.roles && item.roles.length > 0),
|
|
854
|
+
hasAccessLevel: !!item.accessLevel,
|
|
855
|
+
hasHref: !!item.href
|
|
856
|
+
});
|
|
857
|
+
|
|
813
858
|
return true;
|
|
814
859
|
};
|
|
815
860
|
|
|
@@ -847,6 +892,12 @@ export const NavigationMenu = React.forwardRef<
|
|
|
847
892
|
.map(item => filterItem(item))
|
|
848
893
|
.filter((item): item is NavigationItem => item !== null);
|
|
849
894
|
|
|
895
|
+
logger.warn('NavigationMenu', 'filteredItems result', {
|
|
896
|
+
originalItemsCount: items?.length || 0,
|
|
897
|
+
filteredItemsCount: filtered.length,
|
|
898
|
+
permissionMapSize: permissionMap ? Object.keys(permissionMap).length : 0
|
|
899
|
+
});
|
|
900
|
+
|
|
850
901
|
// Update the ref with the new filtered items so we can preserve them during refetches
|
|
851
902
|
previousFilteredItemsRef.current = filtered;
|
|
852
903
|
|