feat: Implement role-based access control (RBAC) with 3-tier authorization

- Add 3 user roles: user, admin, super_admin
- Restrict LLM config management to super_admin only
- Restrict audit logs and statistics to super_admin only
- Update AdminPage with role-based tab visibility
- Add complete 5 Why prompt from 5why-analyzer.jsx
- Add system documentation and authorization guide
- Add ErrorModal component and seed test users script

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
donald
2025-12-08 19:29:28 +08:00
parent 957003bc7c
commit 66cdcacce9
11 changed files with 1791 additions and 158 deletions

View File

@@ -31,7 +31,10 @@ class ApiClient {
return data;
} catch (error) {
console.error('API Error:', error);
// 只對非認證錯誤顯示控制台訊息
if (!endpoint.includes('/auth/me') || !error.message.includes('未登入')) {
console.error('API Error:', error);
}
throw error;
}
}