Space Access
A user with the Read, Write or Admin role works across the whole organization. A user with the Member role works only inside the spaces their teams are granted. Everything else in the organization is hidden from them. This page describes what a Member sees and can do. Roles and grants are set up in Identity & Access and Teams & Space Grants.
Which spaces a Member reaches
- A grant covers its subtree. A grant on a space covers that space and every space below it. A grant on the root space covers every space in the organization.
- The highest grant wins. When several of a Member's teams hold grants on a space or on spaces above it, the Member gets the highest of them there: Write beats Read.
- Changes apply on the next request. Adding or removing a team member, changing or removing a grant, and deleting a team or a space take effect from the Member's next request, without signing in again.
A Member with no grant reaches no space. They can still sign in, edit their own profile, manage their MFA factors and notification settings, view and revoke the API keys they created, and remove watched or favorite stacks. Their watched and favorite lists show only stacks they can read, so with no grant the lists are empty and no stack can be added.
Outside the granted spaces
A stack, run, space or bundle outside a Member's spaces does not exist for them:
- lists, counts and totals leave it out;
- opening it, by URL or through the API, answers
404; - a space list shows the granted spaces only. A granted space whose parent is outside the grant is shown without its parent.
Inside the granted spaces, an action the grant does not allow answers 403 with the error code insufficient_role. For example, a Member with a Read grant who tries to trigger a run gets this answer.
Read and Write per surface
| Surface | Read grant | Write grant adds |
|---|---|---|
| Stacks | View the stacks, their resources, variables, attached bundles, state versions and drift status | Change the source, automation triggers and variables. Attach, detach and reorder bundles that the Member can also read |
| Runs | View runs with their logs, outputs, plan downloads, resources, policy verdict and policy input | Trigger and cancel runs. Re-evaluate a run's policies |
| Approvals | See runs waiting for approval | Approve or discard runs |
| Spaces | View the granted spaces and the spaces below them | Create spaces below a granted space. Edit and delete the granted spaces and the spaces below them |
| Bundles | View bundles that live in the granted spaces | |
| Dashboard | Numbers count only stacks and runs in the granted spaces. The worker pool section is not shown | |
| Live updates | The app receives run updates for the granted spaces only | |
| Emails | Run failed, run finished and drift emails for watched stacks in the granted spaces | Approval-needed emails for those stacks |
| Favorites and watches | Add any stack in the granted spaces. A stack outside them cannot be added |
Live updates. When a Member's access shrinks, the app's live-updates connection closes before the next update reaches them, and the app reconnects with the access they have now. Newly granted spaces appear on the Member's next request, or when they refresh the page.
Emails are decided when they are sent, on the access the Member holds at that moment and on the stack's current space. A Member who loses access to a stack before an email goes out does not receive it. A watched or favorite stack that the Member can no longer read disappears from their lists. It comes back if their access returns.
What stays organization-wide
A grant never gives organization administration. These stay with the organization roles, and a Member is refused (403, error code insufficient_role) whatever their grants:
- organization settings, including the MFA policy;
- users and invitations, teams and grants;
- source control and cloud integrations, VCS connectors;
- plan policies;
- worker pools and their workers;
- webhooks;
- the audit log;
- creating API keys, and other users' API keys;
- creating, renaming and deleting stacks, drift schedules, rolling back state and releasing a state lock;
- creating and editing bundles.
Allowed actions in the API
Stack, run and space responses carry allowed_actions: the actions the caller may take on that resource, decided on its space. The app uses it to show or hide its buttons. A Member with a Read grant gets an empty list on a stack; with a Write grant it holds, for example, run.create and stack.variables_write.
| Resource | Possible values |
|---|---|
| Stack | run.create, stack.source_write, stack.triggers_write, stack.variables_write, stack.bundles_attach, stack.update, stack.delete |
| Run | run.cancel, run.approve, run.reindex, run.policy_evaluate, run.force_cancel |
| Space | space.write |
API keys
An API key's own role is Read, Write or Admin, never Member. When the user who created a key is a Member, the key reaches only the spaces that user's teams are granted, at no more than the key's own role and no more than the grant. Removing the user from a team, or a grant from a team, narrows their keys from the next request.
Terraform
The Terraform provider authenticates with an API key, so it sees no more than the key's owner and no more than the key's own role. With a Member's key, the zenfra_stacks data source returns only stacks in the granted spaces, and reading anything else fails as not found. Teams, team members and grants are managed with zenfra_team, zenfra_team_membership and zenfra_space_grant (see Teams & Space Grants), which need an Admin's key.