mirror of
https://github.com/hansjone/dsh-ops-cron.git
synced 2026-10-11 11:43:24 +08:00
Fix cron cwd for super_admin and harden IM channel job isolation.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
b35bfde557
commit
b1bb0067a0
16 changed files with 714 additions and 49 deletions
|
|
@ -139,6 +139,18 @@ export function viewerPayload(identity) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Default cwd when creating a job in the sidebar.
|
||||
* Prefer the viewer's provisioned workspace over whatever project the session
|
||||
* happens to have open (admins often sit in an unrelated clone).
|
||||
*/
|
||||
export function preferredNewJobCwd({ viewer = null, sessionCwd = '' } = {}) {
|
||||
const provisioned = String(viewer?.workspacePath || '').trim()
|
||||
if (viewer?.mode === 'multi' && provisioned) return provisioned
|
||||
if (provisioned) return provisioned
|
||||
return String(sessionCwd || '').trim()
|
||||
}
|
||||
|
||||
/**
|
||||
* Claim unassigned jobs that clearly belong to the viewer (origin session / cwd).
|
||||
* No-op in standalone / canViewAll. Returns { state, changed }.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue