Remove SuperAdmin
Remove the SuperAdmin panel and role.
Steps
-
Delete directories and files:
app/api/superadmin/(SuperAdmin API routes)app/(dashboard)/dashboard/superadmin/(SuperAdmin panel pages)hooks/core/use-superadmin.ts(client-side SuperAdmin hooks)
-
Update Prisma schema (
prisma/schema.prisma):- Remove
SUPERADMINfrom theRoleenum (keepUSERandADMIN)
- Remove
-
Update auth helpers:
- Remove
getSuperAdminSession()from your auth helpers (or leave it as a no-op) - Update any guards that check for
SUPERADMINrole
- Remove
-
Clean up navigation: Remove SuperAdmin links from the dashboard sidebar.
-
Run
pnpm db:pushto sync the schema.
Note: The regular Admin panel (ADMIN role) is independent and will continue to work.