/** * 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 */ import type { AbilityRegistry } from '@byline/auth'; import type { AdminStore } from '../../store.js'; import type { GetRoleAbilitiesRequest, GetRoleAbilitiesResponse, ListRegisteredAbilitiesResponse, SetRoleAbilitiesRequest, SetRoleAbilitiesResponse, WhoHasAbilityRequest, WhoHasAbilityResponse } from './schemas.js'; /** * Read-only inspector service for admin-permissions. * * Two responsibilities: * * 1. **Enumerate registered abilities.** Pure registry read — no DB * access. The registry is populated at `initBylineCore()` time * by collection auto-registration plus subsystem registrars * (`registerAdminAbilities`). * 2. **Resolve the who-has matrix.** For a given ability key, list * the roles that grant it and the distinct admin users * transitively holding it. Backed by two single-query joins on * the permissions repository, then resolved against the roles * and users repositories so the inspector can render names * without further round-trips. * * The editor surface (`getRoleAbilities` / `setRoleAbilities`) is * deliberately not on this service yet — it lands with Phase B and * will live alongside these methods. */ export declare class AdminPermissionsService { #private; constructor(deps: { store: AdminStore; abilities: AbilityRegistry; }); listRegisteredAbilities(): ListRegisteredAbilitiesResponse; getRoleAbilities(request: GetRoleAbilitiesRequest): Promise; setRoleAbilities(request: SetRoleAbilitiesRequest): Promise; whoHasAbility(request: WhoHasAbilityRequest): Promise; }