Skip to content

Permanent admins, set in the app by a configured admin - #88

Merged
NDL3wis merged 1 commit into
mainfrom
feat/permanent-admin-flag
Nov 5, 2026
Merged

NDL3wis merged 1 commit into
mainfrom
feat/permanent-admin-flag

Conversation

@NDL3wis

@NDL3wis NDL3wis commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Why

Some admins added in Settings should be impossible to remove by accident. Until now only the admins in Admin__BootstrapLoginIds were protected, and that's Azure configuration. #87 tried a committed list, but that would have published admin login IDs in this public repo, so it was closed.

What changed

  • AdminGrants gets a Permanent flag. A permanent admin can't be removed in the app: the server refuses and the Remove button is hidden.
  • Only the admins named in configuration (Admin:BootstrapLoginIds) can turn the flag on or off. They use Make permanent / Clear permanent in Settings → Admins. Other admins see the "permanent" badge but no control.
  • GET /api/admin/admins now also returns canSetPermanent, and each entry returns permanent. New endpoint: PUT /api/admin/admins/{loginId}/permanent with body { permanent }.
  • The flag applies only to admins granted in the app. A configured admin is already permanent, and someone who isn't an admin can't be flagged.
  • Nothing to do with the AI provider or API keys changes. On the Settings page, every change is inside the Admins panel.

Validation

  • dotnet test --filter "Category!=CorpusParity&Category!=LiveApi": 831 passed. New tests cover:
    • only a configured admin can set or clear the flag;
    • a permanent admin can't be removed until it's cleared;
    • configured admins and non-admins can't be flagged.
  • Client npm test -- --run: 218 passed. New tests cover the Make permanent flow (Remove disappears) and a non-configured admin seeing no control.
  • tsc -b and npm run lint are clean.
  • Not checked in a running app.

Deployment notes

  • Migration PermanentAdmins adds one bit column, default 0, so existing admins start not permanent.
  • No App Service or Azure configuration changes.
  • After the deploy, a configured admin clicks Make permanent for the admins who should be permanent.

🤖 Generated with Claude Code

An admin granted in Settings can be marked permanent: they cannot be removed
until the flag is cleared, and only the admins named in server configuration
(Admin:BootstrapLoginIds) can set or clear it. The flag lives on AdminGrants,
not in committed configuration, so admin login IDs are not published in the
public repository.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 741d2394-3b87-4679-b8c4-aff81014e8b0
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@NDL3wis
NDL3wis merged commit dba12ad into main Nov 5, 2026
4 checks passed
@NDL3wis
NDL3wis deleted the feat/permanent-admin-flag branch November 5, 2026 18:30
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