+ {t('user_modules_hint')}
+
+ {all.map((m) => (
+
+ ))}
+
+
+
+
+
+
+ );
+}
diff --git a/frontend/src/pages/Organizacion/UsersPanel.jsx b/frontend/src/pages/Organizacion/UsersPanel.jsx
index 804aefc..210200c 100644
--- a/frontend/src/pages/Organizacion/UsersPanel.jsx
+++ b/frontend/src/pages/Organizacion/UsersPanel.jsx
@@ -1,5 +1,5 @@
import { useState } from 'react';
-import { Plus, Save, UserX, UserCheck, Check, X as XIcon, Mail } from 'lucide-react';
+import { Plus, Save, UserX, UserCheck, Check, X as XIcon, Mail, LayoutGrid } from 'lucide-react';
import { useUi } from '../../context/ui-context.jsx';
import { useAuth } from '../../context/auth-context.jsx';
import { useAsync, useAction } from '../../hooks/useAsync.js';
@@ -12,6 +12,7 @@ import { Field, FieldRow } from '../../components/Field.jsx';
import { ComboBox } from '../../components/ComboBox.jsx';
import { Badge } from '../../components/Badge.jsx';
import { DetailPopup } from '../../components/DetailPopup.jsx';
+import { UserModulesDialog } from './UserModulesDialog.jsx';
import { DraftNotice } from '../../components/DraftNotice.jsx';
import { DraftMark, useGuardedClose } from '../../components/NavigationGuard.jsx';
import { useDraftForm, useUserDrafts, hasDraftFor, useReopenDraft } from '../../hooks/useDraftForm.js';
@@ -34,6 +35,8 @@ export default function UsersPanel() {
const { data: deptTree } = useAsync(listDepartments, []);
const canManage = ['admin', 'superadmin'].includes(currentUser?.roleCode);
+ const isSuperadmin = currentUser?.roleCode === 'superadmin';
+ const [modulesUser, setModulesUser] = useState(null);
const [search, setSearch] = useState('');
const [editing, setEditing] = useState(false);
@@ -179,6 +182,7 @@ export default function UsersPanel() {
}
return [
{ label: t('common_edit'), onClick: () => startEdit(u) },
+ ...(isSuperadmin && u.role_code !== 'superadmin' ? [{ label: t('user_modules'), icon: LayoutGrid, onClick: () => setModulesUser(u) }] : []),
u.is_active
? { label: t('common_inactive'), icon: UserX, danger: true, onClick: () => toggleActive(u) }
: { label: t('common_active'), icon: UserCheck, onClick: () => toggleActive(u) },
@@ -186,6 +190,8 @@ export default function UsersPanel() {
} : undefined}
/>
+ {modulesUser &&