fix: 岗位会商历史按用户隔离,并为 write-file 预览启用 AI 写作视图
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
8c3d6a02fc
commit
8ce3a62826
5 files changed
+67
-38
No files matched your search
+4
-3
@@ -135,8 +135,8 @@ class PositionRoundtableRepository:
|
||||
|
||||
@staticmethod
|
||||
def _can_access(row: PositionRoundtableSessionRow, user_id: str) -> bool:
|
||||
"""Task-bound sessions are shared; unbound legacy sessions stay private."""
|
||||
return bool(row.task_scoped) or row.user_id == user_id
|
||||
"""History is partitioned by creator; even task-bound rows stay private."""
|
||||
return row.user_id == user_id
|
||||
|
||||
@staticmethod
|
||||
def _session_dict(row: PositionRoundtableSessionRow) -> dict[str, Any]:
|
||||
@@ -344,11 +344,12 @@ class PositionRoundtableRepository:
|
||||
async def list_sessions(
|
||||
self, user_id: str, *, external_task_id: str | None = None, limit: int = 50
|
||||
) -> list[dict[str, Any]]:
|
||||
"""List shared task history or the caller's legacy personal history."""
|
||||
"""List the caller's own task history or legacy personal history."""
|
||||
if external_task_id:
|
||||
stmt = select(PositionRoundtableSessionRow).where(
|
||||
PositionRoundtableSessionRow.external_task_id == external_task_id,
|
||||
PositionRoundtableSessionRow.task_scoped.is_(True),
|
||||
PositionRoundtableSessionRow.user_id == user_id,
|
||||
)
|
||||
else:
|
||||
stmt = select(PositionRoundtableSessionRow).where(
|
||||
|
||||
Reference in new issue
Block a user