Add role-based access control (RBAC) with three user roles
This commit introduces a role-based access control system to manage what each user can see and do in ETPL Intelligence.
Three roles are now available:
- Admin: Full access to everything including member management, configuration, and system health monitoring
- Functional: Access to BRD, FRD, and Implementation workflow (Lead to BRD, BRD to FRD, FRD to Implementation), plus document libraries, Ask ETPL, Meetings, Analyze, and Ideas
- Developer: Access only to Dashboard and Zoho Assistant
Backend changes:
- Add DEVELOPER and FUNCTIONAL roles to the role hierarchy (rank-based: Developer=0, Functional=1, Admin=2)
- Keep ANALYST as deprecated alias for FUNCTIONAL for backward compatibility with existing server-side route guards
- Update authentication to assign FUNCTIONAL role to legacy analyst keys
- Update account validation to accept functional and developer role values
Frontend changes:
- Add 'Sections' title label above navigation sidebar for better UX
- Update navigation to filter menu items based on user role
- Add Zoho Assistant as a proper navigation entry with external link handling
- Add conditional panel rendering - views are only mounted if allowed for role
- Add route protection - redirects to safe default if user navigates to unauthorized view
- Update Account Manager to show three role options with descriptions and colored badges
- Update access model description to reflect three roles
- Add CSS styles for new role badges (functional=green, developer=orange)
Files changed:
- packages/platform-core/src/roles.js - New role hierarchy
- packages/platform-core/src/auth.js - Auth with new roles
- packages/platform-core/src/access/accounts.js - Account role validation
- packages/web-ui/src/theme.js - Navigation and role presentation
- packages/web-ui/src/App.jsx - Panel access control
- packages/web-ui/src/Shell.jsx - Navigation rendering
- packages/web-ui/src/AccountManager.jsx - 3-role account form
- packages/web-ui/src/Access.jsx - Access model display
- packages/web-ui/src/Analyze.jsx - Role reference fix
- packages/web-ui/src/Kb.jsx - Role reference fix
- packages/web-ui/src/workflow.js - Route access control
- packages/web-ui/public/app.css - Role badge styles
- packages/web-ui/public/app.js - Rebuilt bundle