From 4f9f456f858471c0accb7374e4ae2f842777961a Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 9 Mar 2026 09:13:24 -0700 Subject: [PATCH] fix(agent): operator role can see all agent instances --- .../interfaces/rest/controllers/agent-instance.controller.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/services/agent-service/src/interfaces/rest/controllers/agent-instance.controller.ts b/packages/services/agent-service/src/interfaces/rest/controllers/agent-instance.controller.ts index 5615005..96f3e44 100644 --- a/packages/services/agent-service/src/interfaces/rest/controllers/agent-instance.controller.ts +++ b/packages/services/agent-service/src/interfaces/rest/controllers/agent-instance.controller.ts @@ -34,8 +34,8 @@ export class AgentInstanceController { const jwt = this.decodeJwt(req.headers?.['authorization'] as string | undefined); const userId = jwt?.sub; const roles: string[] = jwt?.roles ?? []; - // Admins see all instances; regular users only see their own - if (!userId || roles.includes('admin')) { + // Admins and operators see all instances; regular users only see their own + if (!userId || roles.includes('admin') || roles.includes('operator')) { return this.instanceRepo.findAll(); } const instances = await this.instanceRepo.findByUserId(userId);