Files
Davide Silvestri ca3d710b3b feat(agent): choose the identity an Agent runs as (#6540)
* feat(agent): choose the identity an Agent runs as

Agents can run as one of the workspace's Agent identities or with no
workspace access. The tools that act with the identity's permissions
come next.

* fix(agent): refresh the run-as identity label

* fix(agent): flag deleted run-as identities in configuration

* feat(agent): explain unavailable workspace identities

* refactor(agent): return a typed configuration object

* fix(agent): handle run-as identity permissions and lifecycle

* refactor(agent): use constants for readiness and state checks

* fix(agent): record before and after configuration values

* refactor(agent): move configuration transaction to API view

* fix(agent): batch run-as identity invalidations

* test: use real debounce in views admin tests

* fix(agent): keep run-as choices within the viewport

* perf: reuse permission data within batches
2026-11-05 09:16:14 +01:00

9 lines
309 B
JavaScript

import { RUN_AS_STATUS } from '@baserow/modules/agent/constants'
/** Keep the unavailable states distinct from intentionally unset access. */
export const getRunAsStatus = (runAs) =>
runAs
? runAs.status ||
(runAs.trashed ? RUN_AS_STATUS.TRASHED : RUN_AS_STATUS.ACTIVE)
: RUN_AS_STATUS.UNSET