Govern

Access control

Goni's default-deny RBAC: policies.yml, per-id allow-lists, row filters, column masks, and the effective-permissions resolver.

Access control

The RBAC surface. One YAML file, git-versioned, PUT-editable, resolved to effective permissions on every request.

You’ll learn

  • How policies.yml models users, roles, and groups
  • Why every allow-list is default-deny and what that means for onboarding
  • How row filters and column masks apply at query time
  • How allow_save, allow_delete, and allow_admin_policies gate the write surface
  • How the effective-permissions resolver merges roles and how to inspect a principal

The one file

Everything in Goni’s RBAC lives in a single YAML at the store root: policies.yml. Goni ships a first-boot seed and the file is thereafter mutable through the API. Every PUT is validated, written to disk, and git-committed against the same store repo that carries saved queries, dashboards, and charts. History is browsable via GET /api/policies/history and any past revision can be fetched with GET /api/policies/at/{sha}.

The document has three top-level lists:

# policies.yml
users:
  - email: owner@acme.com
    name: Owner
    roles:
      - admin
roles:
  - name: admin
    allow_metrics: ['*']
    allow_models: ['*']
    allow_dashboards: ['*']
    allow_charts: ['*']
    allow_queries: ['*']
    allow_notebooks: ['*']
    allow_connections: ['*']
    allow_pipelines: ['*']
    allow_save: true
    allow_delete: true
    allow_admin_policies: true
groups: []

A user carries roles and groups. A group carries roles. A role carries the allow-lists, the flags, and any row filters or column masks. Groups exist so you can attach the same bundle of roles to many principals without repeating yourself; a policies payload is rejected if a group has no roles or references an unknown role.

Default-deny

Every allow-list is default-deny. An empty list denies. A missing list denies. Only ['*'] or a list of explicit ids grants.

Members who sign in to the app start from their workspace role (owner, admin or member), which grants every artifact class. A list you set for them in the workspace’s policy narrows that class to the ids you list; a class you leave unset follows their role. Access tokens and users defined only in the policy file follow the default-deny rule above.

There are eight allow-lists on every role, one per artifact class:

  • allow_metrics, allow_models (semantic layer)
  • allow_dashboards, allow_charts, allow_queries, allow_notebooks (workspace content)
  • allow_connections, allow_pipelines (connector tab)

Each is a list of ids or the wildcard '*'. A viewer role in the seed is instructive:

- name: viewer
  allow_metrics: ['*']
  allow_models: ['*']
  allow_dashboards: ['*']
  allow_charts: ['*']
  allow_queries: ['*']
  allow_notebooks: ['*']
  # no allow_connections, no allow_pipelines - the connector tab
  # is empty because the two lists are absent, not because the
  # flags are off.

Trap: any admin who provisions a new principal must plant a role with wildcards on the axes that principal is supposed to see. If you skip this, the user signs in to an empty workspace and every catalog endpoint returns []. The shipped trial_owner role exists to prevent this on trial-start onboarding.

Row filters and column masks

Row filters are per-table SQL predicates injected into the FROM clause at query time. Column masks rewrite a specific column to a hashed, redacted, or domain-only form.

- name: eu-analyst
  allow_metrics: ['*']
  allow_models: ['*']
  allow_dashboards: ['*']
  allow_charts: ['*']
  allow_queries: ['*']
  allow_notebooks: ['*']
  row_filters:
    orders: "region = 'EU'"
  column_masks:
    users:
      email: hash
      phone: redact

Row-filter and column-mask keys accept either a bare table name (orders) or a fully qualified schema.table (marts_semantic.fct_orders). The qualified form is required when the same table name exists in more than one schema the role can read.

Mask kinds shipped today are hash, redact, and domain. Row-filter strings pass a shape sanity check on save: no semicolons, no UNION, balanced parentheses. This is not a parser, it is a fence against typo-level abuse. Row filters from multiple roles are OR-merged so adding a role never shrinks what a user can see.

The three write-flags

The allow-lists gate reads. Three booleans gate writes:

  • allow_save - create, update, or PUT any artifact
  • allow_delete - delete any artifact
  • allow_admin_policies - edit policies.yml itself

Only an explicit allow_admin_policies: true grants admin authority; it is never implied by other flags.

PUT /api/policies refuses payloads that:

  1. Leave zero non-disabled users holding allow_admin_policies.
  2. Strip the calling user of allow_admin_policies, unless the request sends confirm_self_demote: true.

Both guards exist so the editor can’t lock itself out of the page that edits the RBAC graph.

Disabled users

Every user carries a disabled: true|false flag alongside their roles and groups. Toggle it with two admin-only endpoints:

  • POST /api/users/{email}/disable sets the flag. The next request the user makes is rejected at auth; existing sessions and PATs are invalidated on the same pass.
  • POST /api/users/{email}/enable clears the flag and restores sign-in.

Both endpoints require allow_admin_policies and write a user.disable or user.enable row to the audit log. A disabled user is skipped by the “at least one admin” guard on PUT /api/policies, so you cannot leave the workspace admin-less by disabling every remaining admin. Disabled users also do not count toward seat billing.

The effective-permissions resolver

On every authenticated request, Goni walks the user’s direct roles plus all roles reached through group membership, merges the allow-lists with union semantics, ORs the boolean flags, OR-merges row filters per table, and takes the strictest mask per (table, column). The resulting EffectivePermissions is what every endpoint and every semantic-layer query reads.

You can inspect the resolver output for any principal from an admin session:

curl -X POST https://your-goni-host/api/policies/resolve \
  -H "Authorization: Bearer $GONI_PAT" \
  -H "Content-Type: application/json" \
  -d '{"principal":"analyst@acme.com","with_trace":true}'

The response returns the merged effective block plus, if with_trace is set, a citation list showing which role or group contributed each grant. /api/policies/resolve also accepts an overlay field carrying an uncommitted Policies document, which is how the role editor previews “what will change” before you save.

Workspaces and membership

Workspaces are named groupings that carve the artifact catalog into scopes: finance, exec, personal, and so on. Every artifact class the RBAC layer knows about (charts, dashboards, notebooks, queries, glossary terms) is either pinned to a workspace via workspace_id or lives in the personal scope.

Each workspace carries a member list of user emails and group names. Members can read and, subject to their role’s allow-lists and write flags, edit the artifacts pinned to that workspace. A non-member has no path to those artifacts: list endpoints hide them, get endpoints return an opaque 404 (never 403, so restricted workspaces are not enumerable through probing), and history and version routes collapse to the same 404.

The enforcement primitive is canAccessWorkspace(workspace_id, perms). Every workspace-scoped read and write runs through it before the per-id allow-list check fires, so the two gates compose: a user with allow_charts: ['*'] still sees only the charts in workspaces they belong to. Cross-workspace moves (a chart moving from finance to exec) go through canMoveArtifact, which requires membership in both the source and the destination workspace plus allow_save.

The personal scope is the default landing scope for artifacts a user creates before they choose to publish into a shared workspace. Today every user in the same Goni tenant can open it, within their role’s allow-lists, so pin anything sensitive to a workspace whose member list holds only the right people.

Coming soon: an owner-only personal scope. Only the artifact’s owner will be a member, so drafts stay private until their author publishes them into a shared workspace.

Terminology

“Workspace” in Goni means the artifact-scope concept described above - a named bundle of dashboards, charts, queries and notebooks owned by a team. It is unrelated to “Google Workspace”, the SSO identity provider that also happens to be called Workspace, and unrelated to “Microsoft Entra” tenants. When this documentation says “your workspace” in an onboarding or PAT context it means the Goni tenant hostname (your-workspace.goni.app); “workspaces” in RBAC or product context always means the artifact-scope grouping. A workspace administrator is a user with the owner or admin role on a Goni workspace, not an administrator of the customer’s identity domain.

Single sign-on (OIDC)

Coming soon: single sign-on for your workspace, with your own identity provider (Google Workspace, Microsoft Entra, Okta, Auth0, or any spec-compliant IdP). On Goni today you sign in with a magic link sent to your work email, and scripts use personal access tokens.

The OIDC login path below is one setting for a whole Goni deployment, which is why it is not yet offered per workspace. On a deployment you run yourself, to enable it:

  1. Register Goni as a client with your IdP; use https://<your-goni-host>/api/auth/oidc/callback as the redirect URI.
  2. Set GONI_OIDC_ENABLED=1, GONI_OIDC_ISSUER, GONI_OIDC_CLIENT_ID, GONI_OIDC_CLIENT_SECRET, and GONI_OIDC_REDIRECT_URL in the deployment.
  3. Optionally restrict which email domains the IdP can sign in with via GONI_OIDC_ALLOWED_DOMAINS (comma-separated). See Environment variables for the full list.

Once enabled, users click Sign in with SSO on the login page, get bounced to your IdP, and land back in Goni with a signed session cookie. First sign-in provisions a user row with the role bundle the shipped oidc_default role in policies.yml names; adjust the role there before rolling out.

SSO users can still be assigned roles and can hold PATs the same way magic-link users can. Disabling a user through POST /api/users/{email}/disable blocks OIDC sign-in on the next round-trip just like it does for the magic-link path.

SCIM directory read

For directory tools that want to enumerate who lives inside a Goni workspace, Goni exposes a read-only SCIM 2.0 surface at /scim/v2:

  • GET /scim/v2/ServiceProviderConfig describes the supported filters.
  • GET /scim/v2/Users lists users in the caller’s workspace as SCIM Resource objects.
  • GET /scim/v2/Users/{id} fetches one user.

All three endpoints require allow_admin_policies on the caller. SCIM is a discovery surface; user creation, updates, and deletes stay behind policies.yml and the admin endpoints.

Editing from the UI

The Access Control page in the Goni app renders the palette. Selecting a role opens a Role Editor drawer with three sub-editors: the pattern list for each allow-list, the row-filter editor keyed by table, and the column-mask editor keyed by table and column. Save issues one PUT through the same policies endpoint the API-only workflow uses, and the drawer stays open in a read-only banner if you are in impersonation mode.

Last updated