feat(assistant): align tool visibility with route audiences
This commit is contained in:
@@ -224,8 +224,26 @@ const COST_TOOLS = new Set([
|
||||
"find_best_project_resource",
|
||||
]);
|
||||
|
||||
/** Tools that follow planningReadProcedure access rules in the main API. */
|
||||
const PLANNING_READ_TOOLS = new Set([
|
||||
"list_allocations",
|
||||
"list_demands",
|
||||
"check_resource_availability",
|
||||
]);
|
||||
|
||||
/** Tools that follow controllerProcedure access rules in the main API. */
|
||||
const CONTROLLER_ONLY_TOOLS = new Set([
|
||||
"search_projects",
|
||||
"get_project",
|
||||
"get_timeline_entries_view",
|
||||
"get_timeline_holiday_overlays",
|
||||
"get_project_timeline_context",
|
||||
"preview_project_shift",
|
||||
"get_statistics",
|
||||
"get_dashboard_detail",
|
||||
"get_skill_gaps",
|
||||
"get_project_health",
|
||||
"get_budget_forecast",
|
||||
"query_change_history",
|
||||
"get_entity_timeline",
|
||||
"export_resources_csv",
|
||||
@@ -356,6 +374,9 @@ export function getAvailableAssistantTools(permissions: Set<PermissionKey>, user
|
||||
if (CONTROLLER_ONLY_TOOLS.has(toolName) && !hasControllerAccess) {
|
||||
return false;
|
||||
}
|
||||
if (PLANNING_READ_TOOLS.has(toolName) && !permissions.has(PermissionKey.VIEW_PLANNING)) {
|
||||
return false;
|
||||
}
|
||||
if (COST_TOOLS.has(toolName) && !permissions.has(PermissionKey.VIEW_COSTS)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user