Skip to content

feat(platform-admin): add super-admin/support roles - #1540

Merged
realcodesiman merged 4 commits into
mainfrom
feat/platform-admin-cache
Oct 24, 2026
Merged

realcodesiman merged 4 commits into
mainfrom
feat/platform-admin-cache

Conversation

@realcodesiman

@realcodesiman realcodesiman commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Replace the abandoned platform-admin authorization cache with uncached authorization reads.
  • Limit platform administrator roles to super-admin and support; only super-admin can add or remove administrators.
  • Keep the required zod dependency fixes in integrations/google-calendar and packages/events.

Why authorization stays uncached

Revoking or changing a platform administrator must take effect on the next request. Authorization therefore reads the persisted PlatformAdmin row directly, avoiding a stale cache window or invalidation dependency.

Changes

  • Remove repository-level Redis caching and cache invalidation from platform-admin authorization.
  • Use one conditional upsert to create or promote the configured root administrator.
  • Remove the unsupported read-only role from the schema-derived UI and every locale.
  • Update support-access documentation and generated invariant mirrors.

Validation

  • pnpm lint
  • pnpm --filter @chatbotx.io/database check-types
  • pnpm --filter @chatbotx.io/business check-types
  • pnpm --filter builder check-types
  • pnpm --filter @chatbotx.io/database test -- __tests__/platform-admin-repository.test.ts
  • pnpm --filter @chatbotx.io/business test -- __tests__/platform-admin.service.test.ts __tests__/is-super-admin.test.ts __tests__/platform-admin-bootstrap.test.ts

Relates to #1540

@github-actions github-actions Bot added the feature New feature or request label Oct 23, 2026
@realcodesiman realcodesiman changed the title feat(platform-admin): cache authorization lookups feat(platform-admin): add super-admin/support roles Oct 24, 2026
Read administrator authorization directly from the database and collapse bootstrap promotion into one upsert.
@realcodesiman
realcodesiman merged commit 5db4198 into main Oct 24, 2026
4 checks passed
@realcodesiman
realcodesiman deleted the feat/platform-admin-cache branch October 24, 2026 08:59
hello-jackytruong referenced this pull request in hello-jackytruong/ChatWorkAI Nov 22, 2026
* feat(platform-admin): cache authorization lookups

* perf(database): simplify platform admin cache invalidation

* feat(platform-admin): add role-based access

* refactor(platform-admin): remove stale administrator roles

Read administrator authorization directly from the database and collapse bootstrap promotion into one upsert.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant