Skip to content

Type Alias: SortManageErrorCode

@kortexya/reasoninglayer


@kortexya/reasoninglayer / SortManageErrorCode

SortManageErrorCode = "sort_manage_not_granted"

Defined in: src/types/sorts.ts:2457

The code every ontology-governance door answers when the authorization context grants no Manage on a sort it would define, change or move (reasoninglayer#1231).

One mapping answers it everywhere, as 403 with a GovernanceRefusalResponse body { error, code, message }:

  • every REST door that defines or changes a sort (reasoninglayer#1233): sorts.createSort, bulkCreateSorts, declareDisjunction, declareIndividual, patchSort, patchSortFeature, removeSortFeature, and POST /api/v1/sorts/proposals/generate; a re-post or a batch entry that changes nothing needs no Manage, and a refused batch writes no sort and binds no prefix;
  • the sort lifecycle routes: sorts.approveSort, proposeDefinition, rejectDefinition, deprecateSort, editSortParents, reparentSort, updateReviewStatus, and the bound completion completeMeet (an operand without Manage);
  • scenarios.materializeScenario, for a sort the scenario creates or extends;
  • numeric-source registration, the source profiling routes and the template review routes;
  • OSFQL: a DEFINE or a change of a sort is an execution failure (422) and an ALTER SORT move is refused (403), both with OsfqlRefusal.code write_refused and OsfqlRefusal.denialCode sort_manage_not_granted; the property-graph routes answer it in error_type.

Nothing is written. The sort routes throw a ForbiddenError: read the code with errorBodyCode(error). It is also a Governance.GovernanceRefusalCode.

try {
await client.sorts.deprecateSort(sortId, { reason: 'Duplicate' });
} catch (error) {
if (errorBodyCode(error) === 'sort_manage_not_granted') askAStewardToDeprecate(sortId);
}