fix: canAccess + isModuleVisible fallback while permissions loading (contacts + settings link)
This commit is contained in:
@@ -51,6 +51,8 @@ export function useWorkspace() {
|
||||
// System admins see all modules regardless of workspace
|
||||
const user = useAuthStore.getState().user;
|
||||
if (user?.is_system_admin) return true;
|
||||
// While permissions are loading (is_system_admin undefined), show everything
|
||||
if (user && user.is_system_admin === undefined) return true;
|
||||
// If no workspace context, show all (backward compatible)
|
||||
if (!context?.workspace_id || !context?.modules?.length) return true;
|
||||
return visibleModuleKeys.has(moduleKey);
|
||||
|
||||
Reference in New Issue
Block a user