- Add
vm:snapshot,vm:rebuild, andvm:clonecapabilities. - Assign them to the standard Team roles.
- Keep Viewer read-only and Billing limited to billing plus read access.
- Export fixtures and verify Central's resolved grants.
- Add immutable, indexed
teamfields to VMs and snapshots. - Require an explicit authorized Team for VM creation.
- Inherit Team attribution for snapshots and derived resources.
- Reject cross-Team clone and rebuild operations.
- Keep legacy unattributed resources operator-only.
Verification:
- A Developer can create a VM in an authorized Team.
- The same user cannot create or derive a VM in another Team.
- Snapshot Team attribution matches its VM.
- Add
permission_query_conditionsfor VM and snapshot lists. - Add
has_permissionchecks for direct document reads. - Scope linked Tasks through their VM.
- Deny reads when grants are missing or malformed.
- Use
frappe.qbfor joins or transformed multi-table queries.
Verification:
- A Viewer sees resources only for Teams with
vm:view. - Direct document access follows the same boundary as list access.
System Managerretains full visibility.
- Apply the authorization decorator to loaded-VM actions.
- Use explicit checks for create, clone, and other cross-resource operations.
- Require both capabilities for composite actions such as restart.
- Preserve existing VM lifecycle validation and error behavior.
Verification:
- Viewer actions are denied.
- Developer actions follow the capability mapping.
- Cross-Team actions are denied.
System Managerremains the sole bypass.
- Add Team-scoped machine list and detail routes.
- Preserve the Central OAuth login flow.
- Ensure route parameters cannot expand the session grant set.
Test with:
- A user who owns Team A
- The same user as Developer in Team B
- A second user as Viewer in Team B
- Sign in to Atlas through Central OAuth.
- Inspect
atlas.atlas.api.iam.session_grants. - Check allowed and denied cases with
atlas.atlas.api.iam.check_session_capability. - Verify list filtering and direct document access for each user.
- Run allowed, denied, and cross-Team VM actions.
- Open the Team-scoped list and detail routes.
- Every Atlas VM and snapshot has an authoritative Team boundary.
- Reads and mutations enforce the same capability model.
- OAuth grants are inspectable without being mutable.
- Automated tests cover allowed, denied, malformed-grant, cross-Team, and
System Managercases. - The manual OAuth-to-resource flow is reproducible on separate Central and Atlas sites.