From b6b05f12dfb6da0112a93b1eb471ab9532026277 Mon Sep 17 00:00:00 2001 From: ngqile Date: Tue, 1 Dec 2026 09:32:21 +0800 Subject: [PATCH] docs(openspec): archive fix-company-scope-fail-closed Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM --- .../.openspec.yaml | 0 .../proposal.md | 0 .../specs/company-scoping/spec.md | 0 .../tasks.md | 0 openspec/specs/company-scoping/spec.md | 17 +++++++++++++++++ 5 files changed, 17 insertions(+) rename openspec/changes/{fix-company-scope-fail-closed => archive/2026-12-01-fix-company-scope-fail-closed}/.openspec.yaml (100%) rename openspec/changes/{fix-company-scope-fail-closed => archive/2026-12-01-fix-company-scope-fail-closed}/proposal.md (100%) rename openspec/changes/{fix-company-scope-fail-closed => archive/2026-12-01-fix-company-scope-fail-closed}/specs/company-scoping/spec.md (100%) rename openspec/changes/{fix-company-scope-fail-closed => archive/2026-12-01-fix-company-scope-fail-closed}/tasks.md (100%) diff --git a/openspec/changes/fix-company-scope-fail-closed/.openspec.yaml b/openspec/changes/archive/2026-12-01-fix-company-scope-fail-closed/.openspec.yaml similarity index 100% rename from openspec/changes/fix-company-scope-fail-closed/.openspec.yaml rename to openspec/changes/archive/2026-12-01-fix-company-scope-fail-closed/.openspec.yaml diff --git a/openspec/changes/fix-company-scope-fail-closed/proposal.md b/openspec/changes/archive/2026-12-01-fix-company-scope-fail-closed/proposal.md similarity index 100% rename from openspec/changes/fix-company-scope-fail-closed/proposal.md rename to openspec/changes/archive/2026-12-01-fix-company-scope-fail-closed/proposal.md diff --git a/openspec/changes/fix-company-scope-fail-closed/specs/company-scoping/spec.md b/openspec/changes/archive/2026-12-01-fix-company-scope-fail-closed/specs/company-scoping/spec.md similarity index 100% rename from openspec/changes/fix-company-scope-fail-closed/specs/company-scoping/spec.md rename to openspec/changes/archive/2026-12-01-fix-company-scope-fail-closed/specs/company-scoping/spec.md diff --git a/openspec/changes/fix-company-scope-fail-closed/tasks.md b/openspec/changes/archive/2026-12-01-fix-company-scope-fail-closed/tasks.md similarity index 100% rename from openspec/changes/fix-company-scope-fail-closed/tasks.md rename to openspec/changes/archive/2026-12-01-fix-company-scope-fail-closed/tasks.md diff --git a/openspec/specs/company-scoping/spec.md b/openspec/specs/company-scoping/spec.md index 3bb8af2..2704b51 100644 --- a/openspec/specs/company-scoping/spec.md +++ b/openspec/specs/company-scoping/spec.md @@ -132,3 +132,20 @@ An audit event and a login-history record SHALL belong to the company of the use - **WHEN** someone fails to sign in with a company code that does not exist - **THEN** the login-history record has no company and only super admins see it + +### Requirement: Invalid admins fail closed + +The system SHALL refuse every company-scoped request from an admin with no company who is not a super admin, and SHALL grant a company user who holds the super admin role only the modules and records their company and other roles allow. + +#### Scenario: Admin without a company who is not a super admin + +- **GIVEN** an admin user with no company and no super admin role +- **WHEN** they open Leads, Events, Users or any other company-scoped list or record +- **THEN** the request is refused with 403 +- **AND** no company's records are returned + +#### Scenario: Company user still holding the super admin role + +- **GIVEN** a user of INS who holds the super admin role and a role granting only Leads +- **WHEN** they open Users or another super admin's email +- **THEN** the request is refused with 403 -- 2.54.1