KamoCRM

Move god mode state to global useUserInfo hook

Fixkamo-internal
Ya
24 Oktoba 2025, 21:44 UTC
Mwandishi
snadjafinia
Ahadi ya
da97785

BREAKING FIX: Properly separates isGod and isGodMode Architecture (as intended): - isGod: Permission from session (GD field) - Can user access god mode? - isGodMode: Global UI state - Is god mode currently ON/OFF? - isGodModeActive(): Returns (isGod AND isGodMode) - Secure check Changes to useUserInfo hook: - Add isGodMode state (global, not local to NavTop) - Add setIsGodMode() to control god mode state globally - isGodModeActive() now checks: isGod (session) AND isGodMode (state) - Auto-loads/saves to localStorage Changes to NavTop: - Remove local godModeActive state - Use global isGodMode from hook - Use setIsGodMode to toggle - Display based on isGodMode state This fixes: - God mode state now accessible from any component - Properly isolated from accepting leads toggle - Secure validation: even if isGodMode=true, returns false if isGod=false Other components can now use: - getIsGod() - Check if user has permission - isGodModeActive() - Check if god mode is permitted AND enabled

Mabadiliko yote

Je, unaona nini kuhusu usafiri?

Kila kitu kinaingia kwenye tovuti yako mwenyewe. Anza kwenye mpango wa bure na usome ukurasa huu tena katika mwezi mmoja.

Kuwa Huru MileleMtazamo wa bei