import { type IntlShape } from "react-intl"; import { type IGrantedWorkspace, type WorkspacePermission, type WorkspacePermissions } from "../../types.js"; export declare const workspacePermissions: WorkspacePermissions; export declare const exportPermissions: WorkspacePermissions; /** * Main workspace permissions imply some of the granular permissions that * we want to explicitly show on UI but not necessarily store on backend. * * Returns the list of these granular permissions. */ export declare const getImplicitGranularPermissions: (workspacePermission: WorkspacePermission) => WorkspacePermissions; /** * Returns hierarchically strongest permission from the list. */ export declare const getWorkspacePermission: (permissions: WorkspacePermissions) => WorkspacePermission; /** * Returns all granular permissions from a list, inluding implicit ones. */ export declare const getGranularPermissions: (permissions: WorkspacePermissions) => WorkspacePermissions; /** * Export permission is a granular permission that has subpermissions, * so sanitization on UI is needed when selecting and deselecting occurs. * * Returns the list of permissions with export permissions sanitized. */ export declare const sanitizeExportPermissions: (changedPermission: WorkspacePermission, permissions: WorkspacePermissions, include: boolean) => WorkspacePermissions; /** * When export permission is not selected, but one of its child permissions is, * we want to show it in indefinite state on UI. * * Returns whether the export permission is indefinite. */ export declare const isExportPermissionIndefinite: (permission: WorkspacePermission, selectedGranularPermissions: WorkspacePermissions) => boolean; /** * In some cases, we want to disable implicit permissions on UI to avoid confusion in the hierarchy. * * Returns whether a permission is disabled. */ export declare const isPermissionDisabled: (permission: WorkspacePermission, selectedWorkspacePermission: WorkspacePermission, selectedGranularPermissions: WorkspacePermissions) => boolean; /** * Before persisting permissions, we want to remove implicit permissions as they are not needed on BE. * * Returns the list of permissions without implicit ones. */ export declare const removeRedundantPermissions: (permissions: WorkspacePermissions) => WorkspacePermissions; /** * Returns whether two workspaces have the same permissions. * * Remark: possible implicit permissions are not removed here. */ export declare const areWorkspacePermissionsEqual: (workspace1: IGrantedWorkspace, workspace2: IGrantedWorkspace) => boolean; /** * Returns human-readable title of effective permissions for UI description. */ export declare const getHumanReadablePermissionsTitle: (permissions: WorkspacePermissions, intl: IntlShape) => string; /** * BE might store redundant permissions like ANALYZE, VIEW in one list. * * Returns whether redundant permissions are present in the list. */ export declare const areRedundantPermissionsPresent: (permissions: WorkspacePermissions) => boolean; //# sourceMappingURL=granularPermissionUtils.d.ts.map