Object access control and access rules as code

## Which objects have their own access rules

Embed
Preview of the card
<a href="https://lucidace.com/help/access-control"><img src="https://lucidace.com/help/_api/public/orgs/af34862a-c837-4478-8335-0505efe40459/spaces/2f4b888b-c4e6-488b-81bd-6e838fb12d2e/pages/2094492b-6141-4187-92cc-2efec1da9aee/social-card.svg?v=3e7ae33eec8b" alt="Object access control and access rules as code" width="600" height="315"></a>

Which objects have their own access rules

Dashboards, insights, folders, flags, experiments, cohorts, notebooks, actions, SQL views, and (since W11) Vision scanners, replay collections (playlists), query endpoints and workflows. Open the object's Access button (scanner table, playlist lock icon, endpoint Settings tab, workflow toolbar).

  • Open (default): anyone with the role permission for that area sees it. A none grant hides it from one person or team.

  • Restricted: only the owner, org admins and the people/teams granted view, edit or manage.

  • A hidden object answers 404 everywhere (get, list, share links, runs), never 403. A view grant can read but not change it (403 on writes).

Endpoints: the ACL gates the app and management API (/v1/projects/{p}/endpoints/{slug}, versions, runs, history). Calls with an endpoint's own API key are not user-scoped and still work.

Workflows live in lc-workflows; it asks lc-api for each request (GET /v1/projects/{p}/objects/workflow/{id}/access) and filters lists with GET /v1/projects/{p}/objects/{type}/hidden ({ids}).

Access rules as code (Terraform)

resource "lucida_object_access" "signups" {
  project_id    = "..."
  resource_type = "insight"     # any type above
  resource_id   = "..."
  restricted    = true
  grants        = jsonencode([{ grantee_kind = "team", grantee_id = "...", level = "edit" }])
}

resource "lucida_project_access_policy" "web" {
  project_id = "..."
  default    = "none"
  resources  = jsonencode({ replay = "read" })
}

Both send managed_by = "terraform". While that marker is stored:

  • the app shows Managed by code (Terraform) and disables the controls;

  • an API write without the marker is refused with 409;

  • a manager/admin can press Take over; the next save sends force: true, which clears the marker. The next terraform plan then shows the drift.

terraform destroy reopens the object (or restores the default policy) with force, which also removes the lock.

Verify: go test ./terraform-provider-lucida/... (TestObjectAccess*, TestProjectAccessPolicy*), cargo test -p lc-api code_lock, go test ./cmd/lc-workflows -run TestWorkflowObjectACL, pnpm --filter web test code-lock.

Updated