Skip to content

Commit 16cab3e

Browse files
lane711claude
andcommitted
docs(www): update feature documentation for v2.16.1
Updated pages: configuration (adminAccessRoles), security (admin access control) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 651c031 commit 16cab3e

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

www/src/app/configuration/page.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ interface SonicJSConfig {
5959
afterAuth?: Middleware[] // Run after authentication
6060
}
6161

62+
// Admin access control
63+
adminAccessRoles?: string[] // Roles that can access /admin (default: ['admin'])
64+
6265
// App metadata
6366
version?: string // Application version
6467
name?: string // Application name
@@ -92,6 +95,21 @@ export default app
9295

9396
</CodeGroup>
9497

98+
### Admin Access Control
99+
100+
By default, only users with the `admin` role can access the `/admin` panel. To allow additional roles, use `adminAccessRoles`:
101+
102+
<CodeGroup title="Admin Access Roles">
103+
104+
```typescript
105+
const app = createSonicJSApp({
106+
// Allow both admin and editor roles to access the admin panel
107+
adminAccessRoles: ['admin', 'editor']
108+
})
109+
```
110+
111+
</CodeGroup>
112+
95113
### With Custom Routes
96114

97115
<CodeGroup title="Custom Routes">

www/src/app/security/page.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ SonicJS enforces role-based permissions across all routes:
3131
| **Author** | Own content | Read only ||||
3232
| **Viewer** | Read only | Read only ||||
3333

34+
- The entire `/admin` panel requires the `admin` role by default
35+
- Customizable via `adminAccessRoles` in `createSonicJSApp()` config
3436
- User management routes require `admin` role
3537
- Content CRUD requires `admin`, `editor`, or `author`
3638
- Collection schema changes require `admin`
@@ -140,6 +142,7 @@ All security audit data is available via authenticated admin API endpoints:
140142

141143
| Version | Date | Changes |
142144
|---------|------|---------|
145+
| v2.16.1 | Apr 2026 | Admin panel restricted to admin role by default, configurable `adminAccessRoles` |
143146
| v2.16.0 | Apr 2026 | BruteForceDetector KV resilience, CSRF exempt path expansion, Authorization header bypass for API clients |
144147
| v2.9.0 | Apr 2026 | RBAC enforcement on all admin routes |
145148
| v2.8.3 | Mar 2026 | SQL injection fix, XSS fixes (reflected + stored), PBKDF2 hashing, CSRF protection, rate limiting, CORS restrictions, security headers, JWT secret to env var |

0 commit comments

Comments
 (0)