Restrict @ mention and session query ACL so admin/user only see owned or workspace sessions.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-10 00:30:46 +08:00
parent e48b8bd082
commit e2c2e949ed
5 changed files with 394 additions and 110 deletions

View file

@ -1,8 +1,8 @@
/**
* Session ownership audit store — sessionId → empNo.
* Session ownership store — sessionId → empNo.
*
* Used for export / analytics. Tenant isolation is workspace-based
* (see dsh-acl.js); missing owner must NOT deny access by itself.
* Used with workspace/cwd checks in dsh-acl.js (owner OR own workspace).
* Missing owner must NOT deny access by itself (legacy sessions).
*/
import { readFile, writeFile, mkdir } from 'node:fs/promises'
import { dirname, resolve } from 'node:path'