@jmruthers/pace-core 0.6.11 → 0.6.12
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/{DataTable-EFYP2QLE.js → DataTable-AQAHSFLM.js} +7 -6
- package/dist/{api-BZR2CYXL.js → api-6OQXYT67.js} +2 -1
- package/dist/{chunk-L5LFKKLJ.js → chunk-2GBDPPUC.js} +1 -1
- package/dist/{chunk-J2KQK6DG.js → chunk-AP5FG7W4.js} +2 -2
- package/dist/{chunk-UZNAFKGW.js → chunk-GHCUP64P.js} +1 -21
- package/dist/{chunk-V7FTM2LU.js → chunk-H6RTU4DZ.js} +37 -19
- package/dist/{chunk-KJXRL3XE.js → chunk-HQTYP6BX.js} +79 -45
- package/dist/{chunk-YFTFFJIV.js → chunk-M7QE7XOA.js} +3 -3
- package/dist/{chunk-YYTWKVHO.js → chunk-MVVWZ7JV.js} +25 -30
- package/dist/{chunk-PCSHBLPB.js → chunk-NJ7FGQWB.js} +5 -5
- package/dist/{chunk-WY6Y7KC3.js → chunk-QWIG36BZ.js} +3 -3
- package/dist/{chunk-4R3T5ENU.js → chunk-S57OLCLO.js} +9 -6
- package/dist/chunk-VFLR5K2H.js +23 -0
- package/dist/{chunk-2OEVOGGR.js → chunk-Y2LWSLLB.js} +41 -25
- package/dist/{chunk-7A6IMHH2.js → chunk-YFGNMB67.js} +75 -6
- package/dist/components.d.ts +3 -3
- package/dist/components.js +13 -12
- package/dist/{functions-DH45k8ec.d.ts → functions-hF5ImHCr.d.ts} +1 -1
- package/dist/hooks.js +8 -7
- package/dist/index.d.ts +5 -5
- package/dist/index.js +17 -16
- package/dist/providers.js +3 -2
- package/dist/rbac/index.d.ts +10 -10
- package/dist/rbac/index.js +9 -8
- package/dist/{types-BE2sEHKd.d.ts → types-Besvoyzb.d.ts} +1 -1
- package/dist/{types-CvOPXWWZ.d.ts → types-CGHrxfqc.d.ts} +3 -0
- package/dist/types.d.ts +2 -2
- package/dist/{usePublicPageContext-B91dGYW1.d.ts → usePublicPageContext-BQrHf95t.d.ts} +1 -1
- package/dist/utils.js +4 -3
- package/docs/api/@jmruthers/namespaces/DialogPortal/README.md +14 -0
- package/docs/api/@jmruthers/namespaces/DialogPortal/variables/displayName.md +11 -0
- package/docs/api/README.md +6 -2
- package/docs/api/_media/README.md +186 -0
- package/docs/api/classes/ColumnFactory.md +225 -0
- package/docs/api/classes/Logger.md +246 -0
- package/docs/api/classes/RBACAuditManager.md +299 -0
- package/docs/api/classes/RBACCache.md +389 -0
- package/docs/api/classes/RBACEngine.md +181 -0
- package/docs/api/classes/SecureSupabaseClient.md +168 -0
- package/docs/api/classes/StorageUtils.md +324 -0
- package/docs/api/enumerations/FileCategory.md +137 -0
- package/docs/api/enumerations/LogLevel.md +43 -0
- package/docs/api/enumerations/RBACErrorCode.md +169 -0
- package/docs/api/enumerations/RPCFunction.md +89 -0
- package/docs/api/functions/AccessDenied.md +30 -0
- package/docs/api/functions/AppSwitcher.md +21 -0
- package/docs/api/functions/Badge.md +42 -0
- package/docs/api/functions/ContextSelector.md +43 -0
- package/docs/api/functions/DataTable.md +36 -0
- package/docs/api/functions/DatePickerWithTimezone.md +28 -0
- package/docs/api/functions/DialogBody.md +24 -0
- package/docs/api/functions/DialogFooter.md +24 -0
- package/docs/api/functions/DialogHeader.md +24 -0
- package/docs/api/functions/ErrorBoundaryProvider.md +28 -0
- package/docs/api/functions/EventServiceProvider.md +28 -0
- package/docs/api/functions/FileDisplay.md +25 -0
- package/docs/api/functions/FileUpload.md +21 -0
- package/docs/api/functions/Form.md +50 -0
- package/docs/api/functions/FormField.md +102 -0
- package/docs/api/functions/Header.md +21 -0
- package/docs/api/functions/InactivityServiceProvider.md +28 -0
- package/docs/api/functions/InactivityWarningModal.md +21 -0
- package/docs/api/functions/Input.md +49 -0
- package/docs/api/functions/NavigationGuard.md +31 -0
- package/docs/api/functions/OrganisationServiceProvider.md +28 -0
- package/docs/api/functions/PaceAppLayout.md +169 -0
- package/docs/api/functions/PasswordChangeForm.md +21 -0
- package/docs/api/functions/ProtectedRoute.md +37 -0
- package/docs/api/functions/PublicPageFooter.md +21 -0
- package/docs/api/functions/PublicPageHeader.md +21 -0
- package/docs/api/functions/PublicPageLayout.md +33 -0
- package/docs/api/functions/PublicPageProvider.md +30 -0
- package/docs/api/functions/Textarea.md +49 -0
- package/docs/api/functions/Toaster.md +34 -0
- package/docs/api/functions/UnifiedAuthProvider.md +28 -0
- package/docs/api/functions/applyPalette.md +33 -0
- package/docs/api/functions/archiveFile.md +47 -0
- package/docs/api/functions/average.md +63 -0
- package/docs/api/functions/buildAppUrl.md +46 -0
- package/docs/api/functions/clearInFlightRequests.md +17 -0
- package/docs/api/functions/clearPalette.md +18 -0
- package/docs/api/functions/clearPublicEventCache.md +18 -0
- package/docs/api/functions/clearPublicFileDisplayCache.md +18 -0
- package/docs/api/functions/clearPublicLogoCache.md +18 -0
- package/docs/api/functions/cn.md +21 -0
- package/docs/api/functions/count.md +56 -0
- package/docs/api/functions/createAuditManager.md +45 -0
- package/docs/api/functions/createBaseClient.md +75 -0
- package/docs/api/functions/createLogger.md +95 -0
- package/docs/api/functions/createRBACConfig.md +21 -0
- package/docs/api/functions/createRBACEngine.md +33 -0
- package/docs/api/functions/createRBACExpressMiddleware.md +84 -0
- package/docs/api/functions/createRBACMiddleware.md +88 -0
- package/docs/api/functions/createSecureClient.md +80 -0
- package/docs/api/functions/createSecureDataAccess.md +39 -0
- package/docs/api/functions/deleteFile.md +33 -0
- package/docs/api/functions/disablePerformanceMonitoring.md +17 -0
- package/docs/api/functions/downloadFile.md +33 -0
- package/docs/api/functions/emitAuditEvent.md +27 -0
- package/docs/api/functions/enablePerformanceMonitoring.md +17 -0
- package/docs/api/functions/err.md +23 -0
- package/docs/api/functions/exportToCSV.md +56 -0
- package/docs/api/functions/exportToCSVWithTableRows.md +46 -0
- package/docs/api/functions/extractEventCodeFromPath.md +24 -0
- package/docs/api/functions/extractFileMetadata.md +33 -0
- package/docs/api/functions/formatCompactNumber.md +27 -0
- package/docs/api/functions/formatCurrency.md +31 -0
- package/docs/api/functions/formatDate.md +23 -0
- package/docs/api/functions/formatDateTime.md +24 -0
- package/docs/api/functions/formatFileSize.md +23 -0
- package/docs/api/functions/formatInTimeZone.md +46 -0
- package/docs/api/functions/formatNumber.md +31 -0
- package/docs/api/functions/formatPercent.md +64 -0
- package/docs/api/functions/formatTime.md +24 -0
- package/docs/api/functions/formatTimeInTimeZone.md +40 -0
- package/docs/api/functions/fromSupabaseClient.md +49 -0
- package/docs/api/functions/fromZonedTime.md +41 -0
- package/docs/api/functions/generateCSVContent.md +55 -0
- package/docs/api/functions/generateFilePath.md +29 -0
- package/docs/api/functions/generateFileUrlsBatch.md +33 -0
- package/docs/api/functions/generatePublicRoutePath.md +27 -0
- package/docs/api/functions/generateUniqueFileName.md +24 -0
- package/docs/api/functions/getAccessLevel.md +48 -0
- package/docs/api/functions/getAllAppPorts.md +19 -0
- package/docs/api/functions/getAllStylePaths.md +15 -0
- package/docs/api/functions/getAppConfig.md +17 -0
- package/docs/api/functions/getAppPort.md +34 -0
- package/docs/api/functions/getBucketName.md +27 -0
- package/docs/api/functions/getCurrentAppId.md +17 -0
- package/docs/api/functions/getCurrentAppName.md +17 -0
- package/docs/api/functions/getFileSizeLimit.md +23 -0
- package/docs/api/functions/getGlobalAuditManager.md +19 -0
- package/docs/api/functions/getInFlightRequestCount.md +19 -0
- package/docs/api/functions/getPerformanceMetrics.md +17 -0
- package/docs/api/functions/getPerformanceSummary.md +17 -0
- package/docs/api/functions/getPermissionMap.md +52 -0
- package/docs/api/functions/getPublicEventCacheStats.md +25 -0
- package/docs/api/functions/getPublicFileDisplayCacheStats.md +25 -0
- package/docs/api/functions/getPublicLogoCacheStats.md +25 -0
- package/docs/api/functions/getPublicUrl.md +39 -0
- package/docs/api/functions/getRBACConfig.md +15 -0
- package/docs/api/functions/getRBACLogger.md +15 -0
- package/docs/api/functions/getRoleContext.md +31 -0
- package/docs/api/functions/getSignedUrl.md +34 -0
- package/docs/api/functions/getStylePath.md +21 -0
- package/docs/api/functions/getTimeZoneDifference.md +40 -0
- package/docs/api/functions/getTimezoneAbbreviation.md +40 -0
- package/docs/api/functions/getUserTimeZone.md +26 -0
- package/docs/api/functions/hasAllPermissions.md +41 -0
- package/docs/api/functions/hasAnyPermission.md +41 -0
- package/docs/api/functions/isDebugMode.md +15 -0
- package/docs/api/functions/isDevelopmentMode.md +15 -0
- package/docs/api/functions/isErr.md +29 -0
- package/docs/api/functions/isOk.md +29 -0
- package/docs/api/functions/isPerformanceMonitoringEnabled.md +17 -0
- package/docs/api/functions/isPermitted.md +58 -0
- package/docs/api/functions/isPermittedCached.md +36 -0
- package/docs/api/functions/isRBACInitialized.md +19 -0
- package/docs/api/functions/isSecureClient.md +38 -0
- package/docs/api/functions/isValidPermission.md +27 -0
- package/docs/api/functions/listFiles.md +29 -0
- package/docs/api/functions/max.md +63 -0
- package/docs/api/functions/min.md +63 -0
- package/docs/api/functions/ok.md +29 -0
- package/docs/api/functions/parseAndNormalizeEventColours.md +105 -0
- package/docs/api/functions/recordAuditEvent.md +23 -0
- package/docs/api/functions/recordPermissionCheck.md +31 -0
- package/docs/api/functions/resetPerformanceMetrics.md +17 -0
- package/docs/api/functions/resolveAppContext.md +27 -0
- package/docs/api/functions/roundToNearestMinutes.md +41 -0
- package/docs/api/functions/sanitizeFormData.md +49 -0
- package/docs/api/functions/sanitizeHtml.md +39 -0
- package/docs/api/functions/sanitizeUserInput.md +27 -0
- package/docs/api/functions/setAppConfig.md +23 -0
- package/docs/api/functions/setGlobalAuditManager.md +25 -0
- package/docs/api/functions/setupRBAC.md +31 -0
- package/docs/api/functions/sum.md +63 -0
- package/docs/api/functions/toZonedTime.md +41 -0
- package/docs/api/functions/uploadFile.md +32 -0
- package/docs/api/functions/useAccessLevel.md +71 -0
- package/docs/api/functions/useAccessibleApps.md +55 -0
- package/docs/api/functions/useAppConfig.md +20 -0
- package/docs/api/functions/useAuthService.md +15 -0
- package/docs/api/functions/useCan.md +99 -0
- package/docs/api/functions/useEventService.md +15 -0
- package/docs/api/functions/useEventTheme.md +26 -0
- package/docs/api/functions/useEvents.md +45 -0
- package/docs/api/functions/useFileReference.md +264 -0
- package/docs/api/functions/useFileReferenceById.md +63 -0
- package/docs/api/functions/useFileReferenceForRecord.md +129 -0
- package/docs/api/functions/useFilesByCategory.md +80 -0
- package/docs/api/functions/useFormDialog.md +62 -0
- package/docs/api/functions/useInactivityService.md +15 -0
- package/docs/api/functions/useInactivityTracker.md +21 -0
- package/docs/api/functions/useIsPublicPage.md +19 -0
- package/docs/api/functions/useMultiplePermissions.md +88 -0
- package/docs/api/functions/useOptionalEvents.md +31 -0
- package/docs/api/functions/useOrganisationPermissions.md +27 -0
- package/docs/api/functions/useOrganisationSecurity.md +15 -0
- package/docs/api/functions/useOrganisationService.md +15 -0
- package/docs/api/functions/useOrganisations.md +48 -0
- package/docs/api/functions/usePermissions.md +130 -0
- package/docs/api/functions/usePublicEvent.md +36 -0
- package/docs/api/functions/usePublicEventCode.md +32 -0
- package/docs/api/functions/usePublicEventLogo.md +48 -0
- package/docs/api/functions/usePublicFileDisplay.md +54 -0
- package/docs/api/functions/usePublicPageContext.md +19 -0
- package/docs/api/functions/usePublicRouteParams.md +31 -0
- package/docs/api/functions/useRBAC.md +21 -0
- package/docs/api/functions/useResolvedScope.md +46 -0
- package/docs/api/functions/useResourcePermissions.md +25 -0
- package/docs/api/functions/useRoleManagement.md +121 -0
- package/docs/api/functions/useSecureSupabase.md +51 -0
- package/docs/api/functions/useSessionRestoration.md +15 -0
- package/docs/api/functions/useSessionTracking.md +62 -0
- package/docs/api/functions/useToast.md +83 -0
- package/docs/api/functions/useUnifiedAuth.md +24 -0
- package/docs/api/functions/useZodForm.md +27 -0
- package/docs/api/functions/validateFileSize.md +31 -0
- package/docs/api/functions/warnIfInsecureClient.md +40 -0
- package/docs/api/functions/withAccessLevelGuard.md +67 -0
- package/docs/api/functions/withPermissionGuard.md +73 -0
- package/docs/api/functions/withRoleGuard.md +86 -0
- package/docs/api/globals.md +502 -0
- package/docs/api/interfaces/AccessDeniedProps.md +87 -0
- package/docs/api/interfaces/AccessibleApp.md +41 -0
- package/docs/api/interfaces/AddressFieldProps.md +195 -0
- package/docs/api/interfaces/AddressFieldRef.md +67 -0
- package/docs/api/interfaces/AggregateConfig.md +35 -0
- package/docs/api/interfaces/AppSwitcherProps.md +51 -0
- package/docs/api/interfaces/AuthSessionData.md +27 -0
- package/docs/api/interfaces/AutocompleteOptions.md +61 -0
- package/docs/api/interfaces/AvatarProps.md +97 -0
- package/docs/api/interfaces/BadgeProps.md +30 -0
- package/docs/api/interfaces/BuildAppUrlOptions.md +41 -0
- package/docs/api/interfaces/ButtonProps.md +46 -0
- package/docs/api/interfaces/CalendarProps.md +60 -0
- package/docs/api/interfaces/CardProps.md +56 -0
- package/docs/api/interfaces/ColorPalette.md +13 -0
- package/docs/api/interfaces/ColorShade.md +58 -0
- package/docs/api/interfaces/ContextSelectorProps.md +131 -0
- package/docs/api/interfaces/DataRecord.md +16 -0
- package/docs/api/interfaces/DataTableAction.md +198 -0
- package/docs/api/interfaces/DataTableColumn.md +422 -0
- package/docs/api/interfaces/DataTableProps.md +511 -0
- package/docs/api/interfaces/DataTableToolbarButton.md +75 -0
- package/docs/api/interfaces/DatePickerWithTimezoneProps.md +75 -0
- package/docs/api/interfaces/DialogBodyProps.md +55 -0
- package/docs/api/interfaces/DialogCloseProps.md +25 -0
- package/docs/api/interfaces/DialogContentProps.md +160 -0
- package/docs/api/interfaces/DialogFooterProps.md +25 -0
- package/docs/api/interfaces/DialogHeaderProps.md +25 -0
- package/docs/api/interfaces/DialogPortalProps.md +19 -0
- package/docs/api/interfaces/DialogProps.md +53 -0
- package/docs/api/interfaces/DialogTriggerProps.md +53 -0
- package/docs/api/interfaces/EmptyStateConfig.md +55 -0
- package/docs/api/interfaces/ErrorBoundaryProps.md +131 -0
- package/docs/api/interfaces/ErrorBoundaryProviderProps.md +31 -0
- package/docs/api/interfaces/ErrorBoundaryState.md +61 -0
- package/docs/api/interfaces/EventAppRoleData.md +54 -0
- package/docs/api/interfaces/ExportColumn.md +69 -0
- package/docs/api/interfaces/ExportOptions.md +109 -0
- package/docs/api/interfaces/FileDisplayProps.md +192 -0
- package/docs/api/interfaces/FileMetadata.md +97 -0
- package/docs/api/interfaces/FileReference.md +89 -0
- package/docs/api/interfaces/FileSizeLimits.md +13 -0
- package/docs/api/interfaces/FileUploadOptions.md +107 -0
- package/docs/api/interfaces/FooterProps.md +37 -0
- package/docs/api/interfaces/FormFieldProps.md +171 -0
- package/docs/api/interfaces/FormProps.md +93 -0
- package/docs/api/interfaces/GrantEventAppRoleParams.md +97 -0
- package/docs/api/interfaces/ImportSummary.md +49 -0
- package/docs/api/interfaces/InactivityWarningModalProps.md +87 -0
- package/docs/api/interfaces/InputProps.md +46 -0
- package/docs/api/interfaces/InvalidScopeError.md +37 -0
- package/docs/api/interfaces/LabelProps.md +85 -0
- package/docs/api/interfaces/LoggerConfig.md +51 -0
- package/docs/api/interfaces/LoginFormProps.md +146 -0
- package/docs/api/interfaces/MissingUserContextError.md +37 -0
- package/docs/api/interfaces/NavigationGuardProps.md +109 -0
- package/docs/api/interfaces/NavigationItem.md +91 -0
- package/docs/api/interfaces/NavigationMenuProps.md +169 -0
- package/docs/api/interfaces/Organisation.md +105 -0
- package/docs/api/interfaces/OrganisationContextRequiredError.md +37 -0
- package/docs/api/interfaces/OrganisationMembership.md +105 -0
- package/docs/api/interfaces/OrganisationSecurityError.md +49 -0
- package/docs/api/interfaces/PaceAppLayoutPermissionConfig.md +127 -0
- package/docs/api/interfaces/PaceAppLayoutRouteConfigItem.md +91 -0
- package/docs/api/interfaces/PaceAppLayoutRoutingConfig.md +79 -0
- package/docs/api/interfaces/PaceLoginPageProps.md +41 -0
- package/docs/api/interfaces/PagePermissionGuardProps.md +143 -0
- package/docs/api/interfaces/PaletteData.md +33 -0
- package/docs/api/interfaces/ParsedAddress.md +91 -0
- package/docs/api/interfaces/PermissionDeniedError.md +37 -0
- package/docs/api/interfaces/ProgressProps.md +35 -0
- package/docs/api/interfaces/ProtectedRouteProps.md +67 -0
- package/docs/api/interfaces/PublicPageFooterProps.md +97 -0
- package/docs/api/interfaces/PublicPageHeaderProps.md +99 -0
- package/docs/api/interfaces/PublicPageLayoutProps.md +153 -0
- package/docs/api/interfaces/RBACAccessValidateParams.md +41 -0
- package/docs/api/interfaces/RBACAccessValidateResult.md +33 -0
- package/docs/api/interfaces/RBACAuditLogParams.md +65 -0
- package/docs/api/interfaces/RBACAuditLogResult.md +41 -0
- package/docs/api/interfaces/RBACContext.md +41 -0
- package/docs/api/interfaces/RBACError.md +37 -0
- package/docs/api/interfaces/RBACLogger.md +97 -0
- package/docs/api/interfaces/RBACNotInitializedError.md +37 -0
- package/docs/api/interfaces/RBACPageAccessCheckParams.md +57 -0
- package/docs/api/interfaces/RBACPerformanceMetrics.md +109 -0
- package/docs/api/interfaces/RBACPermissionCheckParams.md +57 -0
- package/docs/api/interfaces/RBACPermissionCheckResult.md +41 -0
- package/docs/api/interfaces/RBACPermissionsGetParams.md +49 -0
- package/docs/api/interfaces/RBACPermissionsGetResult.md +49 -0
- package/docs/api/interfaces/RBACResult.md +47 -0
- package/docs/api/interfaces/RBACRoleGrantParams.md +49 -0
- package/docs/api/interfaces/RBACRoleGrantResult.md +41 -0
- package/docs/api/interfaces/RBACRoleRevokeParams.md +49 -0
- package/docs/api/interfaces/RBACRoleRevokeResult.md +41 -0
- package/docs/api/interfaces/RBACRoleValidateParams.md +41 -0
- package/docs/api/interfaces/RBACRoleValidateResult.md +49 -0
- package/docs/api/interfaces/RBACRolesListParams.md +41 -0
- package/docs/api/interfaces/RBACRolesListResult.md +57 -0
- package/docs/api/interfaces/RBACSessionTrackParams.md +57 -0
- package/docs/api/interfaces/RBACSessionTrackResult.md +41 -0
- package/docs/api/interfaces/ResourcePermissions.md +119 -0
- package/docs/api/interfaces/RevokeEventAppRoleParams.md +81 -0
- package/docs/api/interfaces/RoleManagementResult.md +41 -0
- package/docs/api/interfaces/SessionRestorationLoaderProps.md +29 -0
- package/docs/api/interfaces/StorageConfig.md +33 -0
- package/docs/api/interfaces/StorageFileInfo.md +57 -0
- package/docs/api/interfaces/StorageFileMetadata.md +113 -0
- package/docs/api/interfaces/StorageListOptions.md +79 -0
- package/docs/api/interfaces/StorageListResult.md +33 -0
- package/docs/api/interfaces/StorageUploadOptions.md +81 -0
- package/docs/api/interfaces/StorageUploadResult.md +49 -0
- package/docs/api/interfaces/StorageUploadSuccess.md +35 -0
- package/docs/api/interfaces/StorageUrlOptions.md +49 -0
- package/docs/api/interfaces/StyleImport.md +17 -0
- package/docs/api/interfaces/SwitchProps.md +30 -0
- package/docs/api/interfaces/TabsContentProps.md +13 -0
- package/docs/api/interfaces/TabsListProps.md +13 -0
- package/docs/api/interfaces/TabsProps.md +13 -0
- package/docs/api/interfaces/TabsTriggerProps.md +41 -0
- package/docs/api/interfaces/TextareaProps.md +43 -0
- package/docs/api/interfaces/ToastActionElement.md +16 -0
- package/docs/api/interfaces/ToastProps.md +13 -0
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +129 -0
- package/docs/api/interfaces/UseAccessibleAppsReturn.md +55 -0
- package/docs/api/interfaces/UseFormDialogOptions.md +49 -0
- package/docs/api/interfaces/UseFormDialogReturn.md +95 -0
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +103 -0
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +91 -0
- package/docs/api/interfaces/UsePublicEventLogoOptions.md +69 -0
- package/docs/api/interfaces/UsePublicEventLogoReturn.md +66 -0
- package/docs/api/interfaces/UsePublicEventOptions.md +29 -0
- package/docs/api/interfaces/UsePublicEventReturn.md +56 -0
- package/docs/api/interfaces/UsePublicFileDisplayOptions.md +39 -0
- package/docs/api/interfaces/UsePublicFileDisplayReturn.md +96 -0
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +76 -0
- package/docs/api/interfaces/UseResolvedScopeOptions.md +49 -0
- package/docs/api/interfaces/UseResolvedScopeReturn.md +39 -0
- package/docs/api/interfaces/UseResourcePermissionsOptions.md +29 -0
- package/docs/api/interfaces/UserEventAccess.md +92 -0
- package/docs/api/interfaces/UserMenuProps.md +69 -0
- package/docs/api/interfaces/UserProfile.md +49 -0
- package/docs/api/type-aliases/AccessLevel.md +11 -0
- package/docs/api/type-aliases/AccessLevelContext.md +14 -0
- package/docs/api/type-aliases/AllPermissions.md +11 -0
- package/docs/api/type-aliases/ApiError.md +37 -0
- package/docs/api/type-aliases/ApiResult.md +19 -0
- package/docs/api/type-aliases/AuditEventType.md +11 -0
- package/docs/api/type-aliases/BadgeVariant.md +18 -0
- package/docs/api/type-aliases/DataTableFeatureConfig.md +14 -0
- package/docs/api/type-aliases/DialogSize.md +13 -0
- package/docs/api/type-aliases/EventAppRole.md +11 -0
- package/docs/api/type-aliases/FileUploadProps.md +15 -0
- package/docs/api/type-aliases/GetRowId.md +33 -0
- package/docs/api/type-aliases/GlobalErrorHandler.md +35 -0
- package/docs/api/type-aliases/GlobalRole.md +11 -0
- package/docs/api/type-aliases/ImportHandlerResult.md +13 -0
- package/docs/api/type-aliases/NavigationMode.md +13 -0
- package/docs/api/type-aliases/Operation.md +11 -0
- package/docs/api/type-aliases/OrganisationContextType.md +13 -0
- package/docs/api/type-aliases/OrganisationRole.md +11 -0
- package/docs/api/type-aliases/PaceAppLayoutProps.md +14 -0
- package/docs/api/type-aliases/Permission.md +11 -0
- package/docs/api/type-aliases/PermissionCheck.md +46 -0
- package/docs/api/type-aliases/PermissionMap.md +11 -0
- package/docs/api/type-aliases/PermissionSource.md +13 -0
- package/docs/api/type-aliases/RBACConfig.md +13 -0
- package/docs/api/type-aliases/RBACFunctionResponse.md +57 -0
- package/docs/api/type-aliases/Scope.md +41 -0
- package/docs/api/type-aliases/SessionType.md +11 -0
- package/docs/api/type-aliases/UUID.md +11 -0
- package/docs/api/type-aliases/UnifiedAuthContextType.md +13 -0
- package/docs/api/type-aliases/UseFileReferenceForRecordReturn.md +161 -0
- package/docs/api/type-aliases/UseFileReferenceOptions.md +35 -0
- package/docs/api/type-aliases/UseFileReferenceReturn.md +13 -0
- package/docs/api/variables/ALL_PERMISSIONS.md +281 -0
- package/docs/api/variables/APP_PATH_MAPPING.md +14 -0
- package/docs/api/variables/AddressField.md +41 -0
- package/docs/api/variables/Alert.md +11 -0
- package/docs/api/variables/AlertDescription.md +11 -0
- package/docs/api/variables/AlertTitle.md +11 -0
- package/docs/api/variables/Avatar.md +13 -0
- package/docs/api/variables/Button.md +31 -0
- package/docs/api/variables/CACHE_PATTERNS.md +89 -0
- package/docs/api/variables/Calendar.md +74 -0
- package/docs/api/variables/Card.md +11 -0
- package/docs/api/variables/CardActions.md +11 -0
- package/docs/api/variables/CardContent.md +11 -0
- package/docs/api/variables/CardDescription.md +11 -0
- package/docs/api/variables/CardFooter.md +11 -0
- package/docs/api/variables/CardHeader.md +11 -0
- package/docs/api/variables/CardTitle.md +11 -0
- package/docs/api/variables/Checkbox.md +11 -0
- package/docs/api/variables/DEFAULT_APP_PORT_MAP.md +14 -0
- package/docs/api/variables/DEFAULT_FILE_SIZE_LIMIT.md +13 -0
- package/docs/api/variables/Dialog.md +14 -0
- package/docs/api/variables/DialogClose.md +14 -0
- package/docs/api/variables/DialogContent.md +28 -0
- package/docs/api/variables/DialogDescription.md +14 -0
- package/docs/api/variables/DialogPortal.md +14 -0
- package/docs/api/variables/DialogTitle.md +14 -0
- package/docs/api/variables/DialogTrigger.md +14 -0
- package/docs/api/variables/EVENT_APP_PERMISSIONS.md +109 -0
- package/docs/api/variables/ErrorBoundary.md +15 -0
- package/docs/api/variables/FILE_SIZE_LIMITS.md +13 -0
- package/docs/api/variables/Footer.md +11 -0
- package/docs/api/variables/GLOBAL_PERMISSIONS.md +29 -0
- package/docs/api/variables/Label.md +34 -0
- package/docs/api/variables/LoadingSpinner.md +28 -0
- package/docs/api/variables/LoginForm.md +34 -0
- package/docs/api/variables/NavigationMenu.md +203 -0
- package/docs/api/variables/ORGANISATION_PERMISSIONS.md +89 -0
- package/docs/api/variables/PAGE_PERMISSIONS.md +93 -0
- package/docs/api/variables/PaceLoginPage.md +40 -0
- package/docs/api/variables/PagePermissionGuard.md +11 -0
- package/docs/api/variables/Progress.md +32 -0
- package/docs/api/variables/SECURE_CLIENT_SYMBOL.md +14 -0
- package/docs/api/variables/STORAGE_CONFIG.md +13 -0
- package/docs/api/variables/Select.md +26 -0
- package/docs/api/variables/SelectContent.md +26 -0
- package/docs/api/variables/SelectGroup.md +26 -0
- package/docs/api/variables/SelectItem.md +26 -0
- package/docs/api/variables/SelectLabel.md +26 -0
- package/docs/api/variables/SelectSeparator.md +26 -0
- package/docs/api/variables/SelectTrigger.md +26 -0
- package/docs/api/variables/SelectValue.md +26 -0
- package/docs/api/variables/SessionRestorationLoader.md +11 -0
- package/docs/api/variables/Switch.md +23 -0
- package/docs/api/variables/Table.md +35 -0
- package/docs/api/variables/TableBody.md +11 -0
- package/docs/api/variables/TableCaption.md +11 -0
- package/docs/api/variables/TableCell.md +11 -0
- package/docs/api/variables/TableFooter.md +11 -0
- package/docs/api/variables/TableHead.md +11 -0
- package/docs/api/variables/TableHeader.md +11 -0
- package/docs/api/variables/TableRow.md +11 -0
- package/docs/api/variables/Tabs.md +25 -0
- package/docs/api/variables/TabsContent.md +24 -0
- package/docs/api/variables/TabsList.md +25 -0
- package/docs/api/variables/TabsTrigger.md +34 -0
- package/docs/api/variables/Toast.md +36 -0
- package/docs/api/variables/ToastAction.md +32 -0
- package/docs/api/variables/ToastClose.md +32 -0
- package/docs/api/variables/ToastDescription.md +32 -0
- package/docs/api/variables/ToastProvider.md +11 -0
- package/docs/api/variables/ToastTitle.md +32 -0
- package/docs/api/variables/ToastViewport.md +26 -0
- package/docs/api/variables/Tooltip.md +34 -0
- package/docs/api/variables/TooltipContent.md +34 -0
- package/docs/api/variables/TooltipProvider.md +11 -0
- package/docs/api/variables/TooltipRoot.md +11 -0
- package/docs/api/variables/TooltipTrigger.md +11 -0
- package/docs/api/variables/UserMenu.md +11 -0
- package/docs/api/variables/emailSchema.md +13 -0
- package/docs/api/variables/logger.md +203 -0
- package/docs/api/variables/nameSchema.md +13 -0
- package/docs/api/variables/passwordSchema.md +13 -0
- package/docs/api/variables/phoneSchema.md +13 -0
- package/docs/api/variables/rbacCache.md +16 -0
- package/docs/api/variables/styleConfig.md +25 -0
- package/docs/api/variables/urlSchema.md +13 -0
- package/docs/api-reference/hooks.md +2 -0
- package/docs/implementation-guides/data-tables.md +8 -0
- package/docs/rbac/getting-started.md +7 -0
- package/docs/rbac/troubleshooting.md +5 -1
- package/package.json +3 -3
- package/src/components/DataTable/hooks/useDataTableEffectiveActions.ts +29 -19
- package/src/components/DataTable/hooks/useDataTableScope.test.ts +5 -13
- package/src/components/DataTable/hooks/useDataTableScope.ts +16 -14
- package/src/components/Dialog/useDialogLifecycle.test.ts +4 -1
- package/src/components/FileDisplay/useFileDisplay.unit.test.ts +12 -8
- package/src/components/PaceAppLayout/PaceAppLayout.edge-cases.test.tsx +33 -9
- package/src/components/PaceAppLayout/useFilteredNavItems.ts +22 -7
- package/src/components/PaceAppLayout/usePaceAppLayoutConfig.ts +44 -23
- package/src/components/PaceAppLayout/usePaceAppLayoutPermissions.ts +1 -1
- package/src/components/PaceAppLayout/usePaceAppLayoutScope.ts +6 -4
- package/src/components/PaceAppLayout/useRoleBasedRouteAccess.ts +2 -2
- package/src/hooks/useAppConfig.unit.test.ts +74 -66
- package/src/hooks/useComponentPerformance.unit.test.tsx +6 -4
- package/src/hooks/useFileUrl.unit.test.ts +1 -3
- package/src/hooks/useInactivityTracker.unit.test.ts +6 -2
- package/src/hooks/usePerformanceMonitor.unit.test.ts +6 -16
- package/src/hooks/usePublicEvent.simple.test.ts +32 -47
- package/src/hooks/usePublicEvent.test.ts +9 -15
- package/src/providers/services/AuthServiceProvider.test.tsx +10 -5
- package/src/providers/services/EventServiceProvider.test.tsx +8 -3
- package/src/providers/services/InactivityServiceProvider.test.tsx +8 -3
- package/src/providers/services/OrganisationServiceProvider.test.tsx +8 -3
- package/src/rbac/README.md +7 -5
- package/src/rbac/api.test.ts +113 -56
- package/src/rbac/api.ts +80 -10
- package/src/rbac/components/NavigationGuard.tsx +2 -1
- package/src/rbac/components/PagePermissionGuard.test.tsx +23 -10
- package/src/rbac/engine.ts +23 -1
- package/src/rbac/hooks/permissions/runPermissionCheck.ts +18 -4
- package/src/rbac/hooks/permissions/useCan.test.ts +59 -20
- package/src/rbac/hooks/permissions/useCan.ts +7 -3
- package/src/rbac/hooks/permissions/useMultiplePermissions.ts +18 -9
- package/src/rbac/hooks/useCan.test.ts +2 -3
- package/src/rbac/hooks/usePageGuardScope.ts +6 -4
- package/src/rbac/hooks/usePagePermissionCheck.ts +4 -4
- package/src/rbac/hooks/useResolvedScope.ts +16 -10
- package/src/rbac/hooks/useResourcePermissions.test.ts +48 -58
- package/src/rbac/hooks/useResourcePermissions.ts +11 -20
- package/src/rbac/types.ts +3 -0
- package/src/services/AuthService.edge-cases.test.ts +2 -2
- package/src/services/EventService.ts +9 -4
- package/src/utils/file-reference/file-reference.test.ts +25 -14
- package/src/utils/supabase/createBaseClient.test.ts +30 -13
- package/docs/api/modules.md +0 -10028
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AccessDenied } from './chunk-
|
|
2
|
-
import { useResolvedScope, scopeEqual, useCan, Alert, AlertTitle, useMultiplePermissions } from './chunk-
|
|
3
|
-
import { useEvents } from './chunk-
|
|
4
|
-
import { useUnifiedAuth, useOrganisations } from './chunk-
|
|
1
|
+
import { AccessDenied } from './chunk-NJ7FGQWB.js';
|
|
2
|
+
import { useResolvedScope, scopeEqual, useCan, Alert, AlertTitle, useMultiplePermissions } from './chunk-H6RTU4DZ.js';
|
|
3
|
+
import { useEvents } from './chunk-QWIG36BZ.js';
|
|
4
|
+
import { useUnifiedAuth, useOrganisations } from './chunk-S57OLCLO.js';
|
|
5
5
|
import { setPrintTitle } from './chunk-D6BMFMQZ.js';
|
|
6
|
-
import { getRBACLogger, isSuperAdmin } from './chunk-
|
|
7
|
-
import { cn, LoadingSpinner } from './chunk-
|
|
6
|
+
import { getRBACLogger, isSuperAdmin } from './chunk-YFGNMB67.js';
|
|
7
|
+
import { cn, LoadingSpinner } from './chunk-VFLR5K2H.js';
|
|
8
8
|
import { createLogger } from './chunk-BTHN5MKC.js';
|
|
9
9
|
import React, { useEffect, useRef, useMemo, useState, useCallback } from 'react';
|
|
10
10
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -58,7 +58,7 @@ function useSuperAdminCheck(userId) {
|
|
|
58
58
|
const startTime = Date.now();
|
|
59
59
|
const checkSuperAdmin = async () => {
|
|
60
60
|
try {
|
|
61
|
-
const { isSuperAdmin: checkSuperAdmin2 } = await import('./api-
|
|
61
|
+
const { isSuperAdmin: checkSuperAdmin2 } = await import('./api-6OQXYT67.js');
|
|
62
62
|
const timeoutPromise = new Promise((_, reject) => {
|
|
63
63
|
setTimeout(() => reject(new Error("Super admin check timeout")), 1e4);
|
|
64
64
|
});
|
|
@@ -141,7 +141,7 @@ function usePageGuardScope({
|
|
|
141
141
|
return newScope;
|
|
142
142
|
}, [effectiveScope, contextAppId, selectedEventId, allowsOptionalContexts]);
|
|
143
143
|
const shouldBypassScopeForSuperAdmin = isSuperAdmin2 === true;
|
|
144
|
-
const scopeForPermissionCheck = shouldBypassScopeForSuperAdmin && !stableScope?.organisationId ? { organisationId: void 0, appId: contextAppId || void 0, eventId: selectedEventId || void 0 } : stableScope;
|
|
144
|
+
const scopeForPermissionCheck = scopeLoading ? null : shouldBypassScopeForSuperAdmin && !stableScope?.organisationId ? { organisationId: void 0, appId: contextAppId || void 0, eventId: selectedEventId || void 0 } : stableScope;
|
|
145
145
|
return {
|
|
146
146
|
effectiveScope,
|
|
147
147
|
stableScope,
|
|
@@ -164,7 +164,7 @@ function usePagePermissionCheck({
|
|
|
164
164
|
isSuperAdmin: isSuperAdmin2,
|
|
165
165
|
appName
|
|
166
166
|
}) {
|
|
167
|
-
const scope = shouldSkipPermissionCheck ? { ...dummyScope, appId: contextAppId } : scopeForPermissionCheck
|
|
167
|
+
const scope = shouldSkipPermissionCheck ? { ...dummyScope, appId: contextAppId } : scopeForPermissionCheck;
|
|
168
168
|
const { can, isLoading: canIsLoading, error: canError } = useCan(
|
|
169
169
|
userId,
|
|
170
170
|
scope,
|
|
@@ -454,9 +454,10 @@ function NavigationGuard({
|
|
|
454
454
|
const validPermissions = (navigationItem.permissions || []).filter(
|
|
455
455
|
(p) => typeof p === "string" && (p.startsWith("read:") || p.startsWith("create:") || p.startsWith("update:") || p.startsWith("delete:"))
|
|
456
456
|
);
|
|
457
|
+
const scopeForCheck = effectiveScope ?? null;
|
|
457
458
|
const { results: permissionResults, isLoading: permissionsLoading, error: permissionsError } = useMultiplePermissions(
|
|
458
459
|
user?.id || "",
|
|
459
|
-
|
|
460
|
+
scopeForCheck,
|
|
460
461
|
validPermissions,
|
|
461
462
|
true
|
|
462
463
|
// Use cache
|
|
@@ -601,13 +602,7 @@ function useResourcePermissions(resource, options = {}) {
|
|
|
601
602
|
selectedEventId: selectedEvent?.event_id || null,
|
|
602
603
|
selectedEventOrganisationId: selectedEvent?.organisation_id || null
|
|
603
604
|
});
|
|
604
|
-
const
|
|
605
|
-
return resolvedScope || {
|
|
606
|
-
organisationId: selectedOrganisation?.id || "",
|
|
607
|
-
eventId: selectedEvent?.event_id || void 0,
|
|
608
|
-
appId: void 0
|
|
609
|
-
};
|
|
610
|
-
}, [resolvedScope, selectedOrganisation?.id, selectedEvent?.event_id]);
|
|
605
|
+
const scopeForPermissionCheck = resolvedScope;
|
|
611
606
|
const hasAppId = !!resolvedScope?.appId;
|
|
612
607
|
const pageId = hasAppId ? resource : void 0;
|
|
613
608
|
const isPagePermission = hasAppId && !!pageId;
|
|
@@ -617,7 +612,7 @@ function useResourcePermissions(resource, options = {}) {
|
|
|
617
612
|
const readPermission = isPagePermission ? `read:page.${resource}` : `read:${resource}`;
|
|
618
613
|
const { can: canCreateResult, isLoading: createLoading, error: createError } = useCan(
|
|
619
614
|
user?.id || "",
|
|
620
|
-
|
|
615
|
+
scopeForPermissionCheck,
|
|
621
616
|
createPermission,
|
|
622
617
|
pageId,
|
|
623
618
|
// Pass resource name as pageId when appId is available to enable page permission checks
|
|
@@ -630,7 +625,7 @@ function useResourcePermissions(resource, options = {}) {
|
|
|
630
625
|
);
|
|
631
626
|
const { can: canUpdateResult, isLoading: updateLoading, error: updateError } = useCan(
|
|
632
627
|
user?.id || "",
|
|
633
|
-
|
|
628
|
+
scopeForPermissionCheck,
|
|
634
629
|
updatePermission,
|
|
635
630
|
pageId,
|
|
636
631
|
// Pass resource name as pageId when appId is available to enable page permission checks
|
|
@@ -643,7 +638,7 @@ function useResourcePermissions(resource, options = {}) {
|
|
|
643
638
|
);
|
|
644
639
|
const { can: canDeleteResult, isLoading: deleteLoading, error: deleteError } = useCan(
|
|
645
640
|
user?.id || "",
|
|
646
|
-
|
|
641
|
+
scopeForPermissionCheck,
|
|
647
642
|
deletePermission,
|
|
648
643
|
pageId,
|
|
649
644
|
// Pass resource name as pageId when appId is available to enable page permission checks
|
|
@@ -656,7 +651,7 @@ function useResourcePermissions(resource, options = {}) {
|
|
|
656
651
|
);
|
|
657
652
|
const { can: canReadResult, isLoading: readLoading, error: readError } = useCan(
|
|
658
653
|
user?.id || "",
|
|
659
|
-
|
|
654
|
+
scopeForPermissionCheck,
|
|
660
655
|
readPermission,
|
|
661
656
|
pageId,
|
|
662
657
|
// Pass resource name as pageId when appId is available to enable page permission checks
|
|
@@ -690,7 +685,7 @@ function useResourcePermissions(resource, options = {}) {
|
|
|
690
685
|
canUpdateResult,
|
|
691
686
|
canDeleteResult,
|
|
692
687
|
canReadResult,
|
|
693
|
-
scope,
|
|
688
|
+
scope: scopeForPermissionCheck,
|
|
694
689
|
isLoading,
|
|
695
690
|
error
|
|
696
691
|
}),
|
|
@@ -703,7 +698,7 @@ function useResourcePermissions(resource, options = {}) {
|
|
|
703
698
|
canUpdateResult,
|
|
704
699
|
canDeleteResult,
|
|
705
700
|
canReadResult,
|
|
706
|
-
|
|
701
|
+
scopeForPermissionCheck,
|
|
707
702
|
isLoading,
|
|
708
703
|
error
|
|
709
704
|
]
|
|
@@ -1050,7 +1045,7 @@ function withPermissionGuard(config, handler) {
|
|
|
1050
1045
|
if (!userId || !organisationId) {
|
|
1051
1046
|
throw new Error("User context required for permission check");
|
|
1052
1047
|
}
|
|
1053
|
-
const { isPermitted: isPermitted2 } = await import('./api-
|
|
1048
|
+
const { isPermitted: isPermitted2 } = await import('./api-6OQXYT67.js');
|
|
1054
1049
|
const result = await isPermitted2({
|
|
1055
1050
|
userId,
|
|
1056
1051
|
scope: { organisationId, eventId, appId },
|
|
@@ -1076,7 +1071,7 @@ function withAccessLevelGuard(minLevel, handler) {
|
|
|
1076
1071
|
if (!userId || !organisationId) {
|
|
1077
1072
|
throw new Error("User context required for access level check");
|
|
1078
1073
|
}
|
|
1079
|
-
const { getAccessLevel: getAccessLevel2 } = await import('./api-
|
|
1074
|
+
const { getAccessLevel: getAccessLevel2 } = await import('./api-6OQXYT67.js');
|
|
1080
1075
|
const result = await getAccessLevel2({
|
|
1081
1076
|
userId,
|
|
1082
1077
|
scope: { organisationId, eventId, appId }
|
|
@@ -1105,7 +1100,7 @@ function withRoleGuard(config, handler) {
|
|
|
1105
1100
|
throw new Error("User context required for role check");
|
|
1106
1101
|
}
|
|
1107
1102
|
if (config.globalRoles && config.globalRoles.length > 0) {
|
|
1108
|
-
const { isSuperAdmin: isSuperAdmin2 } = await import('./api-
|
|
1103
|
+
const { isSuperAdmin: isSuperAdmin2 } = await import('./api-6OQXYT67.js');
|
|
1109
1104
|
const superResult = await isSuperAdmin2(userId);
|
|
1110
1105
|
if (superResult.ok && superResult.data) {
|
|
1111
1106
|
if (organisationId) {
|
|
@@ -1131,7 +1126,7 @@ function withRoleGuard(config, handler) {
|
|
|
1131
1126
|
}
|
|
1132
1127
|
}
|
|
1133
1128
|
if (config.organisationRoles && config.organisationRoles.length > 0) {
|
|
1134
|
-
const { isOrganisationAdmin } = await import('./api-
|
|
1129
|
+
const { isOrganisationAdmin } = await import('./api-6OQXYT67.js');
|
|
1135
1130
|
const orgResult = await isOrganisationAdmin(userId, organisationId);
|
|
1136
1131
|
if (!orgResult.ok) {
|
|
1137
1132
|
throw new Error(orgResult.error.message);
|
|
@@ -1141,7 +1136,7 @@ function withRoleGuard(config, handler) {
|
|
|
1141
1136
|
}
|
|
1142
1137
|
}
|
|
1143
1138
|
if (config.eventAppRoles && config.eventAppRoles.length > 0 && eventId && appId) {
|
|
1144
|
-
const { isEventAdmin } = await import('./api-
|
|
1139
|
+
const { isEventAdmin } = await import('./api-6OQXYT67.js');
|
|
1145
1140
|
const eventResult = await isEventAdmin(userId, { organisationId, eventId, appId });
|
|
1146
1141
|
if (!eventResult.ok) {
|
|
1147
1142
|
throw new Error(eventResult.error.message);
|
|
@@ -1184,7 +1179,7 @@ function createRBACMiddleware(config) {
|
|
|
1184
1179
|
);
|
|
1185
1180
|
if (protectedRoute) {
|
|
1186
1181
|
try {
|
|
1187
|
-
const { isPermitted: isPermitted2 } = await import('./api-
|
|
1182
|
+
const { isPermitted: isPermitted2 } = await import('./api-6OQXYT67.js');
|
|
1188
1183
|
const result = await isPermitted2({
|
|
1189
1184
|
userId,
|
|
1190
1185
|
scope: { organisationId },
|
|
@@ -1211,7 +1206,7 @@ function createRBACExpressMiddleware(config) {
|
|
|
1211
1206
|
return res.status(401).json({ error: "User context required" });
|
|
1212
1207
|
}
|
|
1213
1208
|
try {
|
|
1214
|
-
const { isPermitted: isPermitted2 } = await import('./api-
|
|
1209
|
+
const { isPermitted: isPermitted2 } = await import('./api-6OQXYT67.js');
|
|
1215
1210
|
const result = await isPermitted2({
|
|
1216
1211
|
userId,
|
|
1217
1212
|
scope: { organisationId, eventId, appId },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Card, CardHeader, CardTitle, CardDescription, CardFooter, Button, useResolvedScope } from './chunk-
|
|
2
|
-
import { useEvents, useOrganisationSecurity } from './chunk-
|
|
3
|
-
import { useUnifiedAuth, useOrganisations } from './chunk-
|
|
4
|
-
import { OrganisationContextRequiredError, getRBACLogger, resolveAppContext, getPageScopeType, ContextValidator, getPermissionMap, getRoleContext, getAccessLevel } from './chunk-
|
|
1
|
+
import { Card, CardHeader, CardTitle, CardDescription, CardFooter, Button, useResolvedScope } from './chunk-H6RTU4DZ.js';
|
|
2
|
+
import { useEvents, useOrganisationSecurity } from './chunk-QWIG36BZ.js';
|
|
3
|
+
import { useUnifiedAuth, useOrganisations } from './chunk-S57OLCLO.js';
|
|
4
|
+
import { OrganisationContextRequiredError, getRBACLogger, resolveAppContext, getPageScopeType, ContextValidator, getPermissionMap, getRoleContext, getAccessLevel } from './chunk-YFGNMB67.js';
|
|
5
5
|
import { Logger, logger } from './chunk-BTHN5MKC.js';
|
|
6
6
|
import { createClient } from '@supabase/supabase-js';
|
|
7
7
|
import { ShieldX } from 'lucide-react';
|
|
@@ -9,7 +9,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
9
9
|
import { useState, useCallback, useMemo, useEffect, useRef } from 'react';
|
|
10
10
|
|
|
11
11
|
// src/rbac/utils/clientSecurity.ts
|
|
12
|
-
var SECURE_CLIENT_SYMBOL = Symbol("pace-core-secure-client");
|
|
12
|
+
var SECURE_CLIENT_SYMBOL = /* @__PURE__ */ Symbol("pace-core-secure-client");
|
|
13
13
|
function isSecureClient(client) {
|
|
14
14
|
if (!client) return false;
|
|
15
15
|
return client[SECURE_CLIENT_SYMBOL] === true;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventServiceContext, useEventService, useUnifiedAuth, useOrganisations } from './chunk-
|
|
1
|
+
import { EventServiceContext, useEventService, useUnifiedAuth, useOrganisations } from './chunk-S57OLCLO.js';
|
|
2
2
|
import { logger } from './chunk-BTHN5MKC.js';
|
|
3
3
|
import { useContext, useState, useEffect, useMemo, useRef, useCallback } from 'react';
|
|
4
4
|
|
|
@@ -100,7 +100,7 @@ async function hasPermissionImpl(ctx, permission, orgId) {
|
|
|
100
100
|
const targetOrgId = orgId || ctx.selectedOrganisation?.id;
|
|
101
101
|
if (!targetOrgId || !ctx.user) return false;
|
|
102
102
|
try {
|
|
103
|
-
const { isPermittedCached } = await import('./api-
|
|
103
|
+
const { isPermittedCached } = await import('./api-6OQXYT67.js');
|
|
104
104
|
const scope = {
|
|
105
105
|
organisationId: targetOrgId,
|
|
106
106
|
eventId: ctx.user.user_metadata?.eventId || ctx.user.app_metadata?.eventId,
|
|
@@ -122,7 +122,7 @@ async function getUserPermissionsImpl(ctx, orgId) {
|
|
|
122
122
|
const targetOrgId = orgId || ctx.selectedOrganisation?.id;
|
|
123
123
|
if (!targetOrgId || !ctx.user) return [];
|
|
124
124
|
try {
|
|
125
|
-
const { getPermissionMap } = await import('./api-
|
|
125
|
+
const { getPermissionMap } = await import('./api-6OQXYT67.js');
|
|
126
126
|
const scope = {
|
|
127
127
|
organisationId: targetOrgId,
|
|
128
128
|
eventId: ctx.user.user_metadata?.eventId || ctx.user.app_metadata?.eventId,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { setPrintAppName } from './chunk-D6BMFMQZ.js';
|
|
2
|
-
import { isRBACInitialized, setupRBAC } from './chunk-
|
|
2
|
+
import { isRBACInitialized, setupRBAC } from './chunk-YFGNMB67.js';
|
|
3
3
|
import { assertOrganisationId, assertUserId } from './chunk-4SXLQIZO.js';
|
|
4
4
|
import { secureStorage } from './chunk-RMLY6KB5.js';
|
|
5
5
|
import { createLogger, logger } from './chunk-BTHN5MKC.js';
|
|
@@ -1112,7 +1112,7 @@ var _OrganisationService = class _OrganisationService extends BaseService {
|
|
|
1112
1112
|
return false;
|
|
1113
1113
|
}
|
|
1114
1114
|
try {
|
|
1115
|
-
const { isSuperAdmin: checkSuperAdmin, isRBACInitialized: isRBACInitialized2, setupRBAC: setupRBAC2 } = await import('./api-
|
|
1115
|
+
const { isSuperAdmin: checkSuperAdmin, isRBACInitialized: isRBACInitialized2, setupRBAC: setupRBAC2 } = await import('./api-6OQXYT67.js');
|
|
1116
1116
|
if (!isRBACInitialized2() && this.supabaseClient) {
|
|
1117
1117
|
setupRBAC2(this.supabaseClient);
|
|
1118
1118
|
}
|
|
@@ -1381,7 +1381,7 @@ var _EventService = class _EventService extends BaseService {
|
|
|
1381
1381
|
return;
|
|
1382
1382
|
}
|
|
1383
1383
|
try {
|
|
1384
|
-
const { isRBACInitialized: isRBACInitialized2, isSuperAdmin: checkSuperAdmin, setupRBAC: setupRBAC2 } = await import('./api-
|
|
1384
|
+
const { isRBACInitialized: isRBACInitialized2, isSuperAdmin: checkSuperAdmin, setupRBAC: setupRBAC2 } = await import('./api-6OQXYT67.js');
|
|
1385
1385
|
if (!isRBACInitialized2() && this.supabaseClient) {
|
|
1386
1386
|
setupRBAC2(this.supabaseClient);
|
|
1387
1387
|
}
|
|
@@ -1455,7 +1455,10 @@ var _EventService = class _EventService extends BaseService {
|
|
|
1455
1455
|
// Event methods
|
|
1456
1456
|
setSelectedEvent(event) {
|
|
1457
1457
|
if (event) {
|
|
1458
|
-
|
|
1458
|
+
const orgId = event.organisation_id;
|
|
1459
|
+
const missingOrg = !orgId || typeof orgId === "string" && orgId.trim() === "";
|
|
1460
|
+
const eventToStore = missingOrg && this.selectedOrganisation?.id ? { ...event, organisation_id: this.selectedOrganisation.id } : event;
|
|
1461
|
+
this.selectedEvent = eventToStore;
|
|
1459
1462
|
this.setSelectedEventId?.(event.event_id);
|
|
1460
1463
|
this.persistEventSelection(event.event_id).catch((error) => {
|
|
1461
1464
|
logger.warn("EventService", "Failed to persist event selection:", error);
|
|
@@ -1582,7 +1585,7 @@ var _EventService = class _EventService extends BaseService {
|
|
|
1582
1585
|
async resolveOrganisationIdForRpc() {
|
|
1583
1586
|
let userIsSuperAdmin = this.isSuperAdmin;
|
|
1584
1587
|
try {
|
|
1585
|
-
const { isRBACInitialized: isRBACInitialized2, isSuperAdmin: checkSuperAdmin, setupRBAC: setupRBAC2 } = await import('./api-
|
|
1588
|
+
const { isRBACInitialized: isRBACInitialized2, isSuperAdmin: checkSuperAdmin, setupRBAC: setupRBAC2 } = await import('./api-6OQXYT67.js');
|
|
1586
1589
|
if (!isRBACInitialized2() && this.supabaseClient) {
|
|
1587
1590
|
setupRBAC2(this.supabaseClient);
|
|
1588
1591
|
}
|
|
@@ -2465,7 +2468,7 @@ function useAppIdResolution(supabase, appName, isAuth, currentUserId) {
|
|
|
2465
2468
|
resolvedUserIdRef.current = currentUserId;
|
|
2466
2469
|
const userId = currentUserId;
|
|
2467
2470
|
const appNameValue = appName;
|
|
2468
|
-
import('./api-
|
|
2471
|
+
import('./api-6OQXYT67.js').then(async ({ resolveAppContext, setupRBAC: setupRBAC2 }) => {
|
|
2469
2472
|
try {
|
|
2470
2473
|
setupRBAC2(supabase);
|
|
2471
2474
|
const result = await resolveAppContext({ userId, appName: appNameValue });
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
// src/utils/core/cn.ts
|
|
6
|
+
function cn(...inputs) {
|
|
7
|
+
return twMerge(clsx(inputs));
|
|
8
|
+
}
|
|
9
|
+
var LoadingSpinner = ({
|
|
10
|
+
size = "md",
|
|
11
|
+
className = ""
|
|
12
|
+
}) => {
|
|
13
|
+
const sizeClasses = {
|
|
14
|
+
sm: "size-4",
|
|
15
|
+
md: "size-6",
|
|
16
|
+
lg: "size-8"
|
|
17
|
+
};
|
|
18
|
+
const validSize = size && size in sizeClasses ? size : "md";
|
|
19
|
+
const sizeClass = sizeClasses[validSize];
|
|
20
|
+
return /* @__PURE__ */ jsx("canvas", { className: `inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent motion-reduce:animate-[spin_1.5s_linear_infinite] ${sizeClass} ${className}`.trim(), role: "status", children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Loading..." }) });
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { LoadingSpinner, cn };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Button, IconButton, mergeRefs, Alert, AlertTitle, AlertDescription, ButtonGroup, Card, CardHeader, CardDescription, CardContent, CardFooter, CardTitle, useCan, useResolvedScope } from './chunk-
|
|
1
|
+
import { Button, IconButton, mergeRefs, Alert, AlertTitle, AlertDescription, ButtonGroup, Card, CardHeader, CardDescription, CardContent, CardFooter, CardTitle, useCan, useResolvedScope } from './chunk-H6RTU4DZ.js';
|
|
2
2
|
import { useFocusTrap, useIsPrint, useDataTablePerformance, toast } from './chunk-ENLXB7GP.js';
|
|
3
|
-
import { useUnifiedAuth } from './chunk-
|
|
4
|
-
import { isSuperAdmin } from './chunk-
|
|
3
|
+
import { useUnifiedAuth } from './chunk-S57OLCLO.js';
|
|
4
|
+
import { isSuperAdmin } from './chunk-YFGNMB67.js';
|
|
5
5
|
import { renderSafeHtml } from './chunk-DDMPHZ3D.js';
|
|
6
|
-
import { cn, LoadingSpinner } from './chunk-
|
|
6
|
+
import { cn, LoadingSpinner } from './chunk-VFLR5K2H.js';
|
|
7
7
|
import { createLogger } from './chunk-BTHN5MKC.js';
|
|
8
8
|
import { X as X$1 } from './chunk-CU2BU2MQ.js';
|
|
9
9
|
import * as React7 from 'react';
|
|
@@ -7613,22 +7613,35 @@ function useDataTableEffectiveActions(params) {
|
|
|
7613
7613
|
params.onDeleteSelected
|
|
7614
7614
|
]);
|
|
7615
7615
|
const effectiveActions = useMemo(() => {
|
|
7616
|
+
const defaultEditOnClick = (row) => {
|
|
7617
|
+
if (!permissions.canUpdate.can) {
|
|
7618
|
+
throw new Error("Insufficient permissions to edit this resource");
|
|
7619
|
+
}
|
|
7620
|
+
const rowIndex = data.findIndex((r) => r === row);
|
|
7621
|
+
const rowId = resolvedGetRowId(row, rowIndex >= 0 ? rowIndex : 0);
|
|
7622
|
+
stateActions.setEditingRow(rowId, toCellValueRecord(row));
|
|
7623
|
+
};
|
|
7616
7624
|
const result = [...actions];
|
|
7617
|
-
if (secureFeatures.editing && secureHandlers.onEditRow
|
|
7618
|
-
result.
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
}
|
|
7628
|
-
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
|
|
7625
|
+
if (secureFeatures.editing && secureHandlers.onEditRow) {
|
|
7626
|
+
const existingEditIndex = result.findIndex((a) => a.label === "Edit");
|
|
7627
|
+
if (existingEditIndex >= 0) {
|
|
7628
|
+
const customEdit = result[existingEditIndex];
|
|
7629
|
+
result[existingEditIndex] = {
|
|
7630
|
+
...customEdit,
|
|
7631
|
+
onClick: defaultEditOnClick,
|
|
7632
|
+
icon: customEdit.icon ?? Edit,
|
|
7633
|
+
testId: customEdit.testId ?? "edit",
|
|
7634
|
+
hidden: customEdit.hidden ?? !permissions.canUpdate.can
|
|
7635
|
+
};
|
|
7636
|
+
} else {
|
|
7637
|
+
result.push({
|
|
7638
|
+
label: "Edit",
|
|
7639
|
+
onClick: defaultEditOnClick,
|
|
7640
|
+
icon: Edit,
|
|
7641
|
+
testId: "edit",
|
|
7642
|
+
hidden: !permissions.canUpdate.can
|
|
7643
|
+
});
|
|
7644
|
+
}
|
|
7632
7645
|
}
|
|
7633
7646
|
if (secureFeatures.deletion && secureHandlers.onDeleteRow && !result.some((a) => a.label === "Delete")) {
|
|
7634
7647
|
const handleDelete = createDeleteHandler({
|
|
@@ -9098,10 +9111,13 @@ function useDataTableScope(options) {
|
|
|
9098
9111
|
});
|
|
9099
9112
|
const stableScopeRef = useRef({ ...EMPTY_SCOPE });
|
|
9100
9113
|
if (rawResolvedScope) {
|
|
9114
|
+
const org = rawResolvedScope.organisationId;
|
|
9115
|
+
const ev = rawResolvedScope.eventId;
|
|
9116
|
+
const app = rawResolvedScope.appId;
|
|
9101
9117
|
const newScope = {
|
|
9102
|
-
organisationId:
|
|
9103
|
-
|
|
9104
|
-
|
|
9118
|
+
organisationId: typeof org === "string" && org.trim() !== "" ? org : void 0,
|
|
9119
|
+
eventId: typeof ev === "string" && ev.trim() !== "" ? ev : void 0,
|
|
9120
|
+
appId: typeof app === "string" && app.trim() !== "" ? app : void 0
|
|
9105
9121
|
};
|
|
9106
9122
|
if (!scopeValuesEqual(stableScopeRef.current, newScope)) {
|
|
9107
9123
|
stableScopeRef.current = { ...newScope };
|
|
@@ -9115,9 +9131,9 @@ function useDataTableScope(options) {
|
|
|
9115
9131
|
const hasPageId = !!pageId && typeof pageId === "string";
|
|
9116
9132
|
const canProceedWithoutFullScope = hasPageId && !isPageName;
|
|
9117
9133
|
const shouldWaitForScope = needsAppIdForResolution && !stableScope.appId || scopeLoading && !canProceedWithoutFullScope;
|
|
9118
|
-
const hasScopeValues = stableScope.organisationId || stableScope.appId || stableScope.eventId
|
|
9119
|
-
const effectiveScope = !shouldWaitForScope && hasScopeValues ? stableScope :
|
|
9120
|
-
const consistentScope = effectiveScope
|
|
9134
|
+
const hasScopeValues = !!stableScope.organisationId || !!stableScope.appId || !!stableScope.eventId;
|
|
9135
|
+
const effectiveScope = !shouldWaitForScope && hasScopeValues ? stableScope : null;
|
|
9136
|
+
const consistentScope = effectiveScope;
|
|
9121
9137
|
return { consistentScope };
|
|
9122
9138
|
}
|
|
9123
9139
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { emitAuditEvent, createAuditManager, setGlobalAuditManager } from './chunk-QRYSEPHB.js';
|
|
2
|
+
import { getCurrentAppName } from './chunk-GHCUP64P.js';
|
|
2
3
|
import { createLogger } from './chunk-BTHN5MKC.js';
|
|
3
4
|
import { ok, err } from './chunk-44CNXN4P.js';
|
|
4
5
|
|
|
@@ -1145,11 +1146,28 @@ var RBACEngine = class {
|
|
|
1145
1146
|
try {
|
|
1146
1147
|
const validation = await this.securityMiddleware.validateInput(input, securityContext);
|
|
1147
1148
|
if (!validation.isValid) {
|
|
1149
|
+
const scopeRejected = validation.errors.includes("Invalid scope format");
|
|
1150
|
+
getRBACLogger().warn("[RBAC] Validation failed \u2014 check that an event is selected if the Menu/units page requires it.", {
|
|
1151
|
+
errors: validation.errors,
|
|
1152
|
+
scope: input.scope,
|
|
1153
|
+
permission: input.permission
|
|
1154
|
+
});
|
|
1148
1155
|
RBACSecurityValidator.logSecurityEvent({
|
|
1149
1156
|
type: "invalid_input",
|
|
1150
1157
|
userId,
|
|
1151
|
-
details: {
|
|
1158
|
+
details: {
|
|
1159
|
+
errors: validation.errors,
|
|
1160
|
+
input: JSON.stringify(input),
|
|
1161
|
+
...scopeRejected && { scopeRejected: input.scope }
|
|
1162
|
+
}
|
|
1152
1163
|
});
|
|
1164
|
+
if (scopeRejected) {
|
|
1165
|
+
getRBACLogger().warn("[RBAC] Invalid scope (from middleware). Scope must have at least one of organisationId, eventId, appId; no empty strings.", {
|
|
1166
|
+
scope: input.scope,
|
|
1167
|
+
permission: input.permission,
|
|
1168
|
+
userId
|
|
1169
|
+
});
|
|
1170
|
+
}
|
|
1153
1171
|
return false;
|
|
1154
1172
|
}
|
|
1155
1173
|
const rateLimit = await this.securityMiddleware.checkRateLimit(securityContext);
|
|
@@ -1183,6 +1201,11 @@ var RBACEngine = class {
|
|
|
1183
1201
|
userId,
|
|
1184
1202
|
details: { error: "Invalid scope format", scope }
|
|
1185
1203
|
});
|
|
1204
|
+
getRBACLogger().warn("[RBAC] Invalid scope (engine check). Scope must have at least one of organisationId, eventId, appId; no empty strings.", {
|
|
1205
|
+
scope,
|
|
1206
|
+
permission,
|
|
1207
|
+
userId
|
|
1208
|
+
});
|
|
1186
1209
|
return false;
|
|
1187
1210
|
}
|
|
1188
1211
|
const cacheKey = RBACCache.generateKey(
|
|
@@ -1920,6 +1943,20 @@ var ContextValidator = class {
|
|
|
1920
1943
|
|
|
1921
1944
|
// src/rbac/api.ts
|
|
1922
1945
|
var log4 = createLogger("RBACAPI");
|
|
1946
|
+
var UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
1947
|
+
function normalizeScope(scope) {
|
|
1948
|
+
const org = scope.organisationId;
|
|
1949
|
+
const ev = scope.eventId;
|
|
1950
|
+
const app = scope.appId;
|
|
1951
|
+
const hasOrg = typeof org === "string" && org.trim() !== "";
|
|
1952
|
+
const hasEv = typeof ev === "string" && ev.trim() !== "";
|
|
1953
|
+
const hasApp = typeof app === "string" && app.trim() !== "";
|
|
1954
|
+
return {
|
|
1955
|
+
...hasOrg ? { organisationId: org } : {},
|
|
1956
|
+
...hasEv ? { eventId: ev } : {},
|
|
1957
|
+
...hasApp ? { appId: app } : {}
|
|
1958
|
+
};
|
|
1959
|
+
}
|
|
1923
1960
|
function toApiError(error) {
|
|
1924
1961
|
if (error instanceof RBACNotInitializedError) {
|
|
1925
1962
|
return { code: "RBAC_NOT_INITIALIZED", message: error.message };
|
|
@@ -2050,6 +2087,14 @@ async function getRoleContext(input, appName) {
|
|
|
2050
2087
|
async function isPermitted(input, appName, precomputedSuperAdmin = null) {
|
|
2051
2088
|
try {
|
|
2052
2089
|
const engine = getEngine();
|
|
2090
|
+
if (!input.scope || typeof input.scope !== "object") {
|
|
2091
|
+
return ok(false);
|
|
2092
|
+
}
|
|
2093
|
+
const normalizedInputScope = normalizeScope(input.scope);
|
|
2094
|
+
if (!RBACSecurityValidator.validateScope(normalizedInputScope)) {
|
|
2095
|
+
return ok(false);
|
|
2096
|
+
}
|
|
2097
|
+
let inputWithNormalizedScope = { ...input, scope: normalizedInputScope };
|
|
2053
2098
|
if (precomputedSuperAdmin === true) {
|
|
2054
2099
|
return ok(true);
|
|
2055
2100
|
}
|
|
@@ -2059,10 +2104,27 @@ async function isPermitted(input, appName, precomputedSuperAdmin = null) {
|
|
|
2059
2104
|
return ok(true);
|
|
2060
2105
|
}
|
|
2061
2106
|
}
|
|
2107
|
+
let scopeForCheck = inputWithNormalizedScope.scope;
|
|
2108
|
+
const isPageName = input.pageId && typeof input.pageId === "string" && !UUID_REGEX.test(input.pageId);
|
|
2109
|
+
const hasEventId = typeof scopeForCheck.eventId === "string" && scopeForCheck.eventId.trim() !== "";
|
|
2110
|
+
const noAppId = !scopeForCheck.appId || typeof scopeForCheck.appId === "string" && scopeForCheck.appId.trim() === "";
|
|
2111
|
+
if (isPageName && hasEventId && noAppId) {
|
|
2112
|
+
const currentAppName = getCurrentAppName();
|
|
2113
|
+
if (currentAppName) {
|
|
2114
|
+
try {
|
|
2115
|
+
const { data: app } = await engine["supabase"].from("rbac_apps").select("id").eq("name", currentAppName).eq("is_active", true).maybeSingle();
|
|
2116
|
+
if (app) {
|
|
2117
|
+
scopeForCheck = { ...scopeForCheck, appId: app.id };
|
|
2118
|
+
inputWithNormalizedScope = { ...inputWithNormalizedScope, scope: scopeForCheck };
|
|
2119
|
+
}
|
|
2120
|
+
} catch (_err) {
|
|
2121
|
+
}
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2062
2124
|
let resolvedAppName = appName;
|
|
2063
|
-
if (!resolvedAppName &&
|
|
2125
|
+
if (!resolvedAppName && inputWithNormalizedScope.scope.appId) {
|
|
2064
2126
|
try {
|
|
2065
|
-
const { data } = await engine["supabase"].from("rbac_apps").select("name").eq("id",
|
|
2127
|
+
const { data } = await engine["supabase"].from("rbac_apps").select("name").eq("id", inputWithNormalizedScope.scope.appId).eq("is_active", true).single();
|
|
2066
2128
|
if (data) {
|
|
2067
2129
|
resolvedAppName = data.name;
|
|
2068
2130
|
}
|
|
@@ -2073,7 +2135,7 @@ async function isPermitted(input, appName, precomputedSuperAdmin = null) {
|
|
|
2073
2135
|
if (input.pageId) {
|
|
2074
2136
|
const scopeResult = await getPageScopeType(
|
|
2075
2137
|
input.pageId,
|
|
2076
|
-
|
|
2138
|
+
inputWithNormalizedScope.scope.appId,
|
|
2077
2139
|
resolvedAppName
|
|
2078
2140
|
);
|
|
2079
2141
|
if (!scopeResult.ok) {
|
|
@@ -2088,7 +2150,7 @@ async function isPermitted(input, appName, precomputedSuperAdmin = null) {
|
|
|
2088
2150
|
pageScopeType = "organisation";
|
|
2089
2151
|
}
|
|
2090
2152
|
const validation = await ContextValidator.resolveScopeForPage(
|
|
2091
|
-
|
|
2153
|
+
inputWithNormalizedScope.scope,
|
|
2092
2154
|
pageScopeType,
|
|
2093
2155
|
resolvedAppName,
|
|
2094
2156
|
engine["supabase"]
|
|
@@ -2096,7 +2158,14 @@ async function isPermitted(input, appName, precomputedSuperAdmin = null) {
|
|
|
2096
2158
|
if (!validation.isValid || !validation.resolvedScope) {
|
|
2097
2159
|
throw validation.error || new OrganisationContextRequiredError();
|
|
2098
2160
|
}
|
|
2099
|
-
const validatedScope = validation.resolvedScope;
|
|
2161
|
+
const validatedScope = normalizeScope(validation.resolvedScope);
|
|
2162
|
+
if (!RBACSecurityValidator.validateScope(validatedScope)) {
|
|
2163
|
+
log4.warn("Scope has no valid identifier after normalisation \u2014 skipping engine call", {
|
|
2164
|
+
permission: input.permission,
|
|
2165
|
+
pageId: input.pageId
|
|
2166
|
+
});
|
|
2167
|
+
return ok(false);
|
|
2168
|
+
}
|
|
2100
2169
|
if (pageScopeType === "both" && input.pageId) {
|
|
2101
2170
|
const eventScope = {
|
|
2102
2171
|
organisationId: validatedScope.organisationId,
|
package/dist/components.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { b as UnifiedAuthContextType, U as UnifiedAuthProvider, a as UnifiedAuthProviderProps, u as useUnifiedAuth } from './UnifiedAuthProvider-Bkt_tzdS.js';
|
|
2
|
-
export { A as AddressField, k as AddressFieldProps, l as AddressFieldRef, aK as AggregateConfig, o as Alert, q as AlertDescription, p as AlertTitle, r as Avatar, s as AvatarProps, t as Badge, u as BadgeProps, v as BadgeVariant, B as Button, a as ButtonProps, am as Calendar, an as CalendarProps, C as Card, g as CardActions, i as CardActionsProps, f as CardContent, e as CardDescription, c as CardFooter, b as CardHeader, h as CardProps, d as CardTitle, w as Checkbox, b5 as ContextSelector, b6 as ContextSelectorProps, aF as DataTable, aI as DataTableAction, aH as DataTableColumn, aG as DataTableProps, aJ as DataTableToolbarButton, ao as DatePickerWithTimezone, ap as DatePickerWithTimezoneProps, M as Dialog, V as DialogBody, a4 as DialogBodyProps, Q as DialogClose, a1 as DialogCloseProps, R as DialogContent, $ as DialogContentProps, Y as DialogDescription, W as DialogFooter, a3 as DialogFooterProps, U as DialogHeader, a2 as DialogHeaderProps, N as DialogPortal, a0 as DialogPortalProps, Z as DialogProps, a5 as DialogSize, X as DialogTitle, O as DialogTrigger, _ as DialogTriggerProps, aL as EmptyStateConfig, b8 as ErrorBoundary, ba as ErrorBoundaryProps, b9 as ErrorBoundaryProvider, bc as ErrorBoundaryProviderProps, bb as ErrorBoundaryState, bj as FileDisplay, bk as FileDisplayProps, bh as FileUpload, bi as FileUploadProps, aT as Footer, aU as FooterProps, aM as Form, aN as FormField, aP as FormFieldProps, aO as FormProps, bd as GlobalErrorHandler, aS as Header, I as Input, j as InputProps, L as Label, m as LabelProps, be as LoadingSpinner, aQ as LoginForm, aR as LoginFormProps, b4 as NavigationMenu, bz as PaceAppLayout, bt as PaceAppLayoutPermissionConfig, by as PaceAppLayoutProps, bv as PaceAppLayoutPropsLayout, bw as PaceAppLayoutPropsPermission, bx as PaceAppLayoutPropsRouting, bs as PaceAppLayoutRouteConfigItem, bu as PaceAppLayoutRoutingConfig, bB as PaceLoginPage, bA as PaceLoginPageProps, P as Progress, y as ProgressProps, b2 as ProtectedRoute, b3 as ProtectedRouteProps, aX as PublicPageFooter, b1 as PublicPageFooterProps, aW as PublicPageHeader, b0 as PublicPageHeaderProps, aV as PublicPageLayout, a$ as PublicPageLayoutProps, aY as PublicPageProvider, a6 as Select, aa as SelectContent, a7 as SelectGroup, ac as SelectItem, ab as SelectLabel, ad as SelectSeparator, a9 as SelectTrigger, a8 as SelectValue, bf as SessionRestorationLoader, bg as SessionRestorationLoaderProps, S as Switch, x as SwitchProps, z as Table, E as TableBody, F as TableCaption, G as TableCell, H as TableFooter, J as TableHead, D as TableHeader, K as TableRow, ae as Tabs, ah as TabsContent, al as TabsContentProps, af as TabsList, aj as TabsListProps, ai as TabsProps, ag as TabsTrigger, ak as TabsTriggerProps, T as Textarea, n as TextareaProps, aq as Toast, as as ToastAction, ay as ToastActionElement, ax as ToastClose, aw as ToastDescription, az as ToastProps, at as ToastProvider, av as ToastTitle, au as ToastViewport, ar as Toaster, aA as Tooltip, aC as TooltipContent, aD as TooltipProvider, aE as TooltipRoot, aB as TooltipTrigger, br as UseFileReferenceForRecordReturn, bp as UseFileReferenceOptions, bq as UseFileReferenceReturn, b7 as UserMenu, bl as useFileReference, bn as useFileReferenceById, bm as useFileReferenceForRecord, bo as useFilesByCategory, a_ as useIsPublicPage, aZ as usePublicPageContext } from './usePublicPageContext-
|
|
2
|
+
export { A as AddressField, k as AddressFieldProps, l as AddressFieldRef, aK as AggregateConfig, o as Alert, q as AlertDescription, p as AlertTitle, r as Avatar, s as AvatarProps, t as Badge, u as BadgeProps, v as BadgeVariant, B as Button, a as ButtonProps, am as Calendar, an as CalendarProps, C as Card, g as CardActions, i as CardActionsProps, f as CardContent, e as CardDescription, c as CardFooter, b as CardHeader, h as CardProps, d as CardTitle, w as Checkbox, b5 as ContextSelector, b6 as ContextSelectorProps, aF as DataTable, aI as DataTableAction, aH as DataTableColumn, aG as DataTableProps, aJ as DataTableToolbarButton, ao as DatePickerWithTimezone, ap as DatePickerWithTimezoneProps, M as Dialog, V as DialogBody, a4 as DialogBodyProps, Q as DialogClose, a1 as DialogCloseProps, R as DialogContent, $ as DialogContentProps, Y as DialogDescription, W as DialogFooter, a3 as DialogFooterProps, U as DialogHeader, a2 as DialogHeaderProps, N as DialogPortal, a0 as DialogPortalProps, Z as DialogProps, a5 as DialogSize, X as DialogTitle, O as DialogTrigger, _ as DialogTriggerProps, aL as EmptyStateConfig, b8 as ErrorBoundary, ba as ErrorBoundaryProps, b9 as ErrorBoundaryProvider, bc as ErrorBoundaryProviderProps, bb as ErrorBoundaryState, bj as FileDisplay, bk as FileDisplayProps, bh as FileUpload, bi as FileUploadProps, aT as Footer, aU as FooterProps, aM as Form, aN as FormField, aP as FormFieldProps, aO as FormProps, bd as GlobalErrorHandler, aS as Header, I as Input, j as InputProps, L as Label, m as LabelProps, be as LoadingSpinner, aQ as LoginForm, aR as LoginFormProps, b4 as NavigationMenu, bz as PaceAppLayout, bt as PaceAppLayoutPermissionConfig, by as PaceAppLayoutProps, bv as PaceAppLayoutPropsLayout, bw as PaceAppLayoutPropsPermission, bx as PaceAppLayoutPropsRouting, bs as PaceAppLayoutRouteConfigItem, bu as PaceAppLayoutRoutingConfig, bB as PaceLoginPage, bA as PaceLoginPageProps, P as Progress, y as ProgressProps, b2 as ProtectedRoute, b3 as ProtectedRouteProps, aX as PublicPageFooter, b1 as PublicPageFooterProps, aW as PublicPageHeader, b0 as PublicPageHeaderProps, aV as PublicPageLayout, a$ as PublicPageLayoutProps, aY as PublicPageProvider, a6 as Select, aa as SelectContent, a7 as SelectGroup, ac as SelectItem, ab as SelectLabel, ad as SelectSeparator, a9 as SelectTrigger, a8 as SelectValue, bf as SessionRestorationLoader, bg as SessionRestorationLoaderProps, S as Switch, x as SwitchProps, z as Table, E as TableBody, F as TableCaption, G as TableCell, H as TableFooter, J as TableHead, D as TableHeader, K as TableRow, ae as Tabs, ah as TabsContent, al as TabsContentProps, af as TabsList, aj as TabsListProps, ai as TabsProps, ag as TabsTrigger, ak as TabsTriggerProps, T as Textarea, n as TextareaProps, aq as Toast, as as ToastAction, ay as ToastActionElement, ax as ToastClose, aw as ToastDescription, az as ToastProps, at as ToastProvider, av as ToastTitle, au as ToastViewport, ar as Toaster, aA as Tooltip, aC as TooltipContent, aD as TooltipProvider, aE as TooltipRoot, aB as TooltipTrigger, br as UseFileReferenceForRecordReturn, bp as UseFileReferenceOptions, bq as UseFileReferenceReturn, b7 as UserMenu, bl as useFileReference, bn as useFileReferenceById, bm as useFileReferenceForRecord, bo as useFilesByCategory, a_ as useIsPublicPage, aZ as usePublicPageContext } from './usePublicPageContext-BQrHf95t.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
export { D as DataRecord, G as GetRowId, u as useToast } from './pagination-BW1mqywp.js';
|
|
5
5
|
export { F as FileCategory, b as FileMetadata, a as FileReference, c as FileUploadOptions } from './file-reference-DU1hcawx.js';
|
|
6
6
|
export { A as AutocompleteOptions, P as ParsedAddress } from './types-Dr8sNhER.js';
|
|
7
|
-
export { a as NavigationItem, N as NavigationMenuProps } from './types-
|
|
7
|
+
export { a as NavigationItem, N as NavigationMenuProps } from './types-Besvoyzb.js';
|
|
8
8
|
import 'react';
|
|
9
9
|
import '@supabase/supabase-js';
|
|
10
10
|
import './api-result-USV1Czr-.js';
|
|
@@ -21,7 +21,7 @@ import '@radix-ui/react-tooltip';
|
|
|
21
21
|
import '@tanstack/react-table';
|
|
22
22
|
import 'react-hook-form';
|
|
23
23
|
import 'zod';
|
|
24
|
-
import './types-
|
|
24
|
+
import './types-CGHrxfqc.js';
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* @file DateTimeField Component
|
package/dist/components.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
export { AddressField, Avatar, Badge, Calendar, ContextSelector, DatePickerWithTimezone, ErrorBoundary, ErrorBoundaryProvider, FileDisplay, FileUpload, Footer, Form, FormField, Header, LoginForm, NavigationMenu, PaceAppLayout, PaceLoginPage, ProtectedRoute, PublicPageFooter, PublicPageHeader, PublicPageLayout, PublicPageProvider, SessionRestorationLoader, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, UserMenu, useFileReference, useFileReferenceById, useFileReferenceForRecord, useFilesByCategory } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import { Label, Input } from './chunk-
|
|
4
|
-
export { Checkbox, DataTable, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, Input, Label, Progress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from './chunk-
|
|
5
|
-
export { Alert, AlertDescription, AlertTitle, Button, Card, CardActions, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger } from './chunk-
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
1
|
+
export { AddressField, Avatar, Badge, Calendar, ContextSelector, DatePickerWithTimezone, ErrorBoundary, ErrorBoundaryProvider, FileDisplay, FileUpload, Footer, Form, FormField, Header, LoginForm, NavigationMenu, PaceAppLayout, PaceLoginPage, ProtectedRoute, PublicPageFooter, PublicPageHeader, PublicPageLayout, PublicPageProvider, SessionRestorationLoader, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, UserMenu, useFileReference, useFileReferenceById, useFileReferenceForRecord, useFilesByCategory } from './chunk-HQTYP6BX.js';
|
|
2
|
+
import './chunk-NJ7FGQWB.js';
|
|
3
|
+
import { Label, Input } from './chunk-Y2LWSLLB.js';
|
|
4
|
+
export { Checkbox, DataTable, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, Input, Label, Progress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from './chunk-Y2LWSLLB.js';
|
|
5
|
+
export { Alert, AlertDescription, AlertTitle, Button, Card, CardActions, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger } from './chunk-H6RTU4DZ.js';
|
|
6
|
+
import './chunk-AP5FG7W4.js';
|
|
7
|
+
import './chunk-QWIG36BZ.js';
|
|
8
8
|
export { useToast } from './chunk-ENLXB7GP.js';
|
|
9
|
-
export { useIsPublicPage, usePublicPageContext } from './chunk-
|
|
9
|
+
export { useIsPublicPage, usePublicPageContext } from './chunk-2GBDPPUC.js';
|
|
10
10
|
import './chunk-C7NSAPTL.js';
|
|
11
|
-
export { UnifiedAuthProvider, useUnifiedAuth } from './chunk-
|
|
11
|
+
export { UnifiedAuthProvider, useUnifiedAuth } from './chunk-S57OLCLO.js';
|
|
12
12
|
import './chunk-D6BMFMQZ.js';
|
|
13
|
-
import './chunk-
|
|
13
|
+
import './chunk-YFGNMB67.js';
|
|
14
14
|
import './chunk-QRYSEPHB.js';
|
|
15
15
|
export { FileCategory } from './chunk-6QYDGKQY.js';
|
|
16
16
|
import './chunk-4SXLQIZO.js';
|
|
17
17
|
import { toZonedTime, fromZonedTime, getUserTimeZone } from './chunk-XOJME5T7.js';
|
|
18
18
|
import './chunk-DDMPHZ3D.js';
|
|
19
|
-
import { cn } from './chunk-
|
|
20
|
-
export { LoadingSpinner } from './chunk-
|
|
19
|
+
import { cn } from './chunk-VFLR5K2H.js';
|
|
20
|
+
export { LoadingSpinner } from './chunk-VFLR5K2H.js';
|
|
21
21
|
import './chunk-XPFVT3GN.js';
|
|
22
22
|
import './chunk-RMLY6KB5.js';
|
|
23
|
+
import './chunk-GHCUP64P.js';
|
|
23
24
|
import './chunk-BTHN5MKC.js';
|
|
24
25
|
import './chunk-44CNXN4P.js';
|
|
25
26
|
import './chunk-CU2BU2MQ.js';
|