[DOCS+KB] Gestione documentale: help (Permessi documentali) + i18n matrice IT/EN + ingest KB AI (v1.24.3)
- help.js: sezione 'Permessi documentali (ciclo di vita SGSI)' nel help Impostazioni - settings.html: matrice permessi bilingue IT/EN (azioni/ruoli/hint) + cache-buster help.js - KB AI: docs/kb/GESTIONE_DOCUMENTALE_SGSI.md + application/cli/ingest_doc_management_kb.php (ingerito in nis2_kb scope SYSTEM, ricercabilita verificata) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
e245e76671
commit
7b8a604739
+16
-7
@@ -701,7 +701,7 @@
|
||||
</script>
|
||||
<script src="/js/common-bi.js?v=20260631"></script>
|
||||
<script src="/js/i18n.js?v=20260631"></script>
|
||||
<script src="/js/help.js?v=20260618p2"></script>
|
||||
<script src="/js/help.js?v=20260620c"></script>
|
||||
<script>
|
||||
// ── Auth check ───────────────────────────────────────────
|
||||
if (!checkAuth()) throw new Error('Not authenticated');
|
||||
@@ -750,8 +750,17 @@
|
||||
}
|
||||
|
||||
// ── Permessi documentali (matrice Ruolo x Azione) ──
|
||||
const DOCPERM_CAP_LABELS = { edit:'Modifica contenuto', submit:'Invia in revisione', approve:'Approva', publish:'Pubblica', reject:'Rimanda in bozza', archive:'Archivia', new_version:'Nuova versione' };
|
||||
const DOCPERM_ROLE_LABELS = { org_admin:'Amministratore', compliance_manager:'Resp. SGSI/Compliance', board_member:'Direzione/CdA', auditor:'Auditor', employee:'Dipendente', consultant:'Consulente' };
|
||||
const _dpLang = function(){ try { return (window.I18n && I18n.getLang && I18n.getLang()) || 'it'; } catch(e){ return 'it'; } };
|
||||
const DOCPERM_CAP_LABELS = {
|
||||
it: { edit:'Modifica contenuto', submit:'Invia in revisione', approve:'Approva', publish:'Pubblica', reject:'Rimanda in bozza', archive:'Archivia', new_version:'Nuova versione' },
|
||||
en: { edit:'Edit content', submit:'Submit for review', approve:'Approve', publish:'Publish', reject:'Send back to draft', archive:'Archive', new_version:'New version' }
|
||||
};
|
||||
const DOCPERM_ROLE_LABELS = {
|
||||
it: { org_admin:'Amministratore', compliance_manager:'Resp. SGSI/Compliance', board_member:'Direzione/CdA', auditor:'Auditor', employee:'Dipendente', consultant:'Consulente' },
|
||||
en: { org_admin:'Administrator', compliance_manager:'ISMS/Compliance Mgr', board_member:'Board/Management', auditor:'Auditor', employee:'Employee', consultant:'Consultant' }
|
||||
};
|
||||
function _dpCap(c){ const l=_dpLang(); return (DOCPERM_CAP_LABELS[l]&&DOCPERM_CAP_LABELS[l][c]) || DOCPERM_CAP_LABELS.it[c] || c; }
|
||||
function _dpRole(r){ const l=_dpLang(); return (DOCPERM_ROLE_LABELS[l]&&DOCPERM_ROLE_LABELS[l][r]) || DOCPERM_ROLE_LABELS.it[r] || r; }
|
||||
let _docpermCanEdit = false;
|
||||
async function loadDocPerms(){
|
||||
const box = document.getElementById('docperms-matrix');
|
||||
@@ -762,11 +771,11 @@
|
||||
const roles = r.data.roleList || [];
|
||||
_docpermCanEdit = !!r.data.canEdit;
|
||||
let h = '<div style="overflow-x:auto;"><table style="width:100%;border-collapse:collapse;font-size:.88rem;">';
|
||||
h += '<tr><th style="text-align:left;padding:8px;border-bottom:2px solid #e5e7eb;">Azione</th>';
|
||||
roles.forEach(function(role){ h += '<th style="padding:8px;border-bottom:2px solid #e5e7eb;text-align:center;">'+(DOCPERM_ROLE_LABELS[role]||role)+'</th>'; });
|
||||
h += '<tr><th style="text-align:left;padding:8px;border-bottom:2px solid #e5e7eb;">'+(_dpLang()==='en'?'Action':'Azione')+'</th>';
|
||||
roles.forEach(function(role){ h += '<th style="padding:8px;border-bottom:2px solid #e5e7eb;text-align:center;">'+_dpRole(role)+'</th>'; });
|
||||
h += '</tr>';
|
||||
caps.forEach(function(c){
|
||||
h += '<tr><td style="padding:8px;border-bottom:1px solid #f1f5f9;font-weight:600;">'+(DOCPERM_CAP_LABELS[c.capability]||c.capability)+'</td>';
|
||||
h += '<tr><td style="padding:8px;border-bottom:1px solid #f1f5f9;font-weight:600;">'+_dpCap(c.capability)+'</td>';
|
||||
roles.forEach(function(role){
|
||||
const checked = c.roles[role] ? 'checked' : '';
|
||||
const dis = _docpermCanEdit ? '' : 'disabled';
|
||||
@@ -778,7 +787,7 @@
|
||||
const saveBtn = document.getElementById('docperms-save');
|
||||
const hint = document.getElementById('docperms-hint');
|
||||
if (saveBtn) saveBtn.style.display = _docpermCanEdit ? '' : 'none';
|
||||
if (hint) hint.textContent = _docpermCanEdit ? 'Suggerimento: lascia almeno un ruolo per ogni azione critica (approva, pubblica).' : 'Solo Amministratore o Direzione possono modificare i permessi.';
|
||||
if (hint) hint.textContent = _docpermCanEdit ? (_dpLang()==='en'?'Tip: keep at least one role enabled for critical actions (approve, publish).':'Suggerimento: lascia almeno un ruolo per ogni azione critica (approva, pubblica).') : (_dpLang()==='en'?'Only Administrator or Management can change permissions.':'Solo Amministratore o Direzione possono modificare i permessi.');
|
||||
}
|
||||
async function saveDocPerms(){
|
||||
if (!_docpermCanEdit) return;
|
||||
|
||||
Reference in New Issue
Block a user