/** * This Source Code is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright (c) Infonomic Company Limited */ /** * Module-local error codes for admin-permissions. * * `ROLE_NOT_FOUND` covers the editor (and future grant/revoke) paths; * `ABILITY_UNREGISTERED` is reserved for the editor too — when a client * tries to grant an ability key that no subsystem has registered. The * inspector is read-only and never throws either of these. */ export declare const AdminPermissionsErrorCodes: { readonly ROLE_NOT_FOUND: 'admin.permissions.roleNotFound'; readonly ABILITY_UNREGISTERED: 'admin.permissions.abilityUnregistered'; }; export type AdminPermissionsErrorCode = (typeof AdminPermissionsErrorCodes)[keyof typeof AdminPermissionsErrorCodes]; export interface AdminPermissionsErrorOptions { message?: string; cause?: unknown; } export declare class AdminPermissionsError extends Error { readonly code: AdminPermissionsErrorCode; constructor(code: AdminPermissionsErrorCode, options: { message: string; cause?: unknown; }); } export declare const ERR_ADMIN_PERMISSIONS_ROLE_NOT_FOUND: (options?: AdminPermissionsErrorOptions) => AdminPermissionsError; export declare const ERR_ADMIN_PERMISSIONS_ABILITY_UNREGISTERED: (options?: AdminPermissionsErrorOptions) => AdminPermissionsError;