mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-19 01:43:17 +08:00
Unify admin-class workspace create and restore Add-workspace UI.
Give admin the same permissions as super/fallback, occupy directoryFlow at priority 1 so the button renders without colliding with the native picker, and inject uiWorkspace for pickDirectory. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
060500360d
commit
91d2515205
9 changed files with 211 additions and 146 deletions
|
|
@ -411,9 +411,13 @@ export function createSessionAccess({
|
|||
return !!store.resolvePermissions(empNo).canViewAllSessions
|
||||
}
|
||||
if (identity.permissions?.canViewAllSessions) return true
|
||||
// No store (tests / misconfig): keep legacy super visibility.
|
||||
// No store (tests / misconfig): admin-class sees all by default.
|
||||
// If permissions were supplied and view-all is off, respect that.
|
||||
if (identity.permissions && Object.prototype.hasOwnProperty.call(identity.permissions, 'canViewAllSessions')) {
|
||||
return !!identity.permissions.canViewAllSessions
|
||||
}
|
||||
const role = identity.role || identity.userContext?.role
|
||||
return role === 'super_admin' || role === 'fallback_admin'
|
||||
return role === 'super_admin' || role === 'fallback_admin' || role === 'admin'
|
||||
|| String(empNo) === 'administrator'
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue