import { DisplayableAction } from './ActionType'; import { EncodedScope, UserScopeV2 } from '../scopes'; import { EventIndexWithAdministrativeHierarchy } from './locations'; import { UserContext } from '../users/User'; import { EventIndex } from './EventIndex'; import { UUID } from 'src/uuid'; export declare const ACTION_SCOPE_MAP: { READ: "record.read"[]; CREATE: "record.create"[]; NOTIFY: "record.notify"[]; DECLARE: ("record.declare" | "record.register")[]; EDIT: "record.edit"[]; DELETE: ("record.declare" | "record.notify")[]; REGISTER: "record.register"[]; PRINT_CERTIFICATE: "record.print-certified-copies"[]; REQUEST_CORRECTION: ("record.request-correction" | "record.correct")[]; REVIEW_CORRECTION_REQUEST: "record.correct"[]; REJECT_CORRECTION: "record.correct"[]; APPROVE_CORRECTION: "record.correct"[]; MARK_AS_DUPLICATE: "record.review-duplicates"[]; MARK_AS_NOT_DUPLICATE: "record.review-duplicates"[]; ARCHIVE: "record.archive"[]; REJECT: "record.reject"[]; ASSIGN: null; UNASSIGN: null; DUPLICATE_DETECTED: never[]; CUSTOM: never[]; }; export declare function hasAnyOfScopes(a: string[], b: string[]): boolean; export declare const AssignmentStatus: { readonly ASSIGNED_TO_SELF: "ASSIGNED_TO_SELF"; readonly ASSIGNED_TO_OTHERS: "ASSIGNED_TO_OTHERS"; readonly UNASSIGNED: "UNASSIGNED"; }; export type AssignmentStatus = (typeof AssignmentStatus)[keyof typeof AssignmentStatus]; export declare function getAssignmentStatus(eventState: EventIndex | EventIndexWithAdministrativeHierarchy, userId: string): AssignmentStatus; /** * Checks if a given action is allowed for the provided scopes, event, and user context. * * This function determines whether the user, with the given set of scopes, is authorized * to perform the specified action on the given event. It checks both legacy V1 scopes * (hardcoded, non-configurable) and V2 scopes, which validate event type, jurisdiction, * and user context via {@link userCanAccessEventWithScopes}. * * @param {EncodedScope[]} scopes - The raw encoded scope strings the user possesses (from JWT). * @param {DisplayableAction} action - The action to check authorization for. * @param {EventIndexWithAdministrativeHierarchy} event - The event with resolved administrative hierarchy. * @param {UserContext} currentUser - The current user's context used for V2 scope validation. * @returns {boolean} True if the action is in scope for the user, otherwise false. */ export declare function isActionInScope({ scopes, action, event, currentUser }: { scopes: EncodedScope[]; action: DisplayableAction; event: EventIndexWithAdministrativeHierarchy; currentUser: UserContext; }): boolean; /** * * * @param allRoles - All possible roles in the system * @param userLocation - The location and role information of the user whose role options are being determined * @param acceptedScopes - The scopes of the user requesting the role update, used to determine which roles they can assign. * @param userRequesting - The user context of the user requesting the role update, used to check location-based access to the target user's location. * * @returns An array of roles that the requesting user is allowed to assign to the target user based on their scopes and location * * 1) Used to determine which roles should be available in the dropdown when a user is editing another user's role in the user management interface. * 2) Used to check if payload includes valid role. */ export declare function getAvailableRolesForUserUpdatePayload({ allRoles, userLocation, acceptedScopes, userRequesting }: { allRoles: string[]; userRequesting: UserContext; acceptedScopes: UserScopeV2[]; userLocation: { administrativeHierarchy: UUID[]; primaryOfficeId: UUID; }; }): string[]; //# sourceMappingURL=scopes.d.ts.map