Skip to content

fix(access-control): keep the settings page open while an organization is governed - #7890

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/access-control-during-dunning
Sep 16, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/access-control-during-dunning

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #7886, which stopped a failing payment from lifting an organization's permission groups. That fix left the two halves disagreeing: the restrictions kept applying, but the Access Control page was still hidden with the rest of the Enterprise sections — so an organization could be governed by rules nobody could see or loosen until the invoice cleared.

  • OrganizationSettingsFeatures gains governanceActive, and Access Control reads it instead of the plan gate. It defaults to the plan gate, so every other caller keeps its current behaviour untouched.
  • The page gate and the navigation both pass the real value, so what the nav lists and what the route opens agree.
  • The management API goes back to the governance reader. It had been deliberately left on the plan gate so it could not open while the page 404'd; with the page fixed, that reason is gone.
  • Nothing else moves: every other section still reads the plan gate, because withholding a feature during a payment failure is the safe direction — withholding a restriction is not.

Only Access Control performs the extra lookup, so no other settings page pays for it.

Type of Change

  • Bug fix

Testing

Tested manually. bun run lint, bun run type-check, bun run check:audits (46 audits), bun run check:api-validation and bun run docs-manifest:check all pass; the full suite runs 52,295 tests green. New tests cover an organization that is governed without an active plan (page opens, nav lists it), one that is governed by nothing (both closed), and that no other section reads governance — each verified to fail without the change.

Also removes a stray Open http://localhost:3000 line from the README's self-hosted quick start. The fuller self-hosting section below it already tells you where to look once the wizard finishes, so the line was duplicating that a few paragraphs earlier.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…n is governed

Permission groups keep applying through a failing payment, but the page
that edits them was hidden with the rest of the Enterprise sections — so
an organization could be governed by rules nobody could see or loosen
until the invoice cleared. Access Control now follows the governance
reader rather than the plan gate, on the page, in the navigation, and at
the management API, which had already been left behind the plan gate to
match the page.

Also drops a stray "Open localhost" line from the README's self-hosted
quick start; the walkthrough below it already says where to look.
@vercel

vercel Bot commented Sep 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 16, 2026 8:31pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 10 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/organizations/surface.ts Outdated
Comment thread apps/sim/components/settings/navigation.ts
Comment thread apps/sim/app/api/organizations/[id]/permission-groups/utils.ts Outdated
@greptile-apps

greptile-apps Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the previous authorization, shared-surface failure, and redundant-read findings are resolved without introducing a new actionable issue.

Summary

This PR keeps Access Control available while an organization’s permission-group regime remains active, even when its ordinary Enterprise plan gate closes during a payment failure.

  • Separates governance availability from ordinary Enterprise feature availability across organization and workspace settings.
  • Aligns navigation, page authorization, and permission-group management API behavior.
  • Prevents governance lookup failures in shared organization navigation data from breaking unrelated organization pages.
  • Removes an unnecessary README quick-start line.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Open organization or workspace settings] --> B{Access Control section?}
  B -- No --> C[Read ordinary Enterprise plan gate]
  B -- Yes --> D[Read active permission-group regime]
  C --> E[Evaluate section availability]
  D --> E
  E --> F{Available and caller authorized?}
  F -- Yes --> G[Show and open section]
  F -- No --> H[Hide or deny section]
Loading

Reviews (2) · Last reviewed commit: "fix(access-control): read the active per..."

Comment thread apps/sim/components/settings/navigation.ts
Comment thread apps/sim/lib/organizations/surface.ts
Comment thread apps/sim/lib/settings/application/organization-section-access.ts Outdated
- Resolve the navigation flag rather than reject it: the organization
  surface is shared by every page, so a failed billing read would have
  taken home, chat and search down with the settings sidebar
- Read the regime helper everywhere instead of the governance reader, so
  a deployment with Access Control switched off manages nothing
- Give the workspace-scoped page the same treatment as the organization
  one, which was still plan-gated
- Read one lookup per section rather than both, since Access Control's
  availability never consults the plan
- Refresh the navigation flag from the billing summary alongside the plan
  it sits next to, so the item cannot linger after billing changes
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 13 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 212a3a9 into staging Sep 16, 2026
33 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/access-control-during-dunning branch September 16, 2026 20:47

This branch was previously deployed

1 inactive deployment
Preview a60c56da Deployed Sep 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant