Перейти к основному содержимому

rolesForEndpoint

@mineflow/api-schemas


@mineflow/api-schemas / rolesForEndpoint

Function: rolesForEndpoint()

function rolesForEndpoint(method: string, path: string): readonly SystemRole[];

Defined in: packages/api-schemas/src/index.ts:76

Роли с доступом к эндпоинту (@RequiresRole). Пустой массив, если эндпоинт не найден или @Public. Канонический способ гейтить UI-действие по тому же контракту, что enforce'ит бэк.

Parameters​

ParameterType
methodstring
pathstring

Returns​

readonly SystemRole[]