- Shiked
- 24 Ekim 2025 21:01 UTC
- Yazar
- snadjafinia
- Commit
- f02f3a8
Backend changes (app/api/user-info/route.ts): - Read GD field from Redis session data - Map to isGod in API response Frontend changes (app/hooks/useUserInfo.tsx): - Add isGod field to UserInfo interface - Add getIsGod() method to hook - Export getIsGod for components UI changes (app/components/NavTop.tsx): - Add god mode toggle (purple theme) - Only visible to users with isGod permission (GD=true) - Toggle state stored in localStorage - Independent on/off control for god mode Flow: 1. User has is_god=true in database 2. SecurityService stores GD=true in Redis session 3. /api/user-info returns isGod=true 4. NavTop shows god mode toggle 5. User can enable/disable god mode (UI state only) Two-level permission: - isGod: Permission to SEE the toggle (from database) - godModeActive: Current UI state (localStorage)