فینورا پرو - سامانه جامع حسابداری و صدور فاکتور

fix(A03): scope chain verification to active authorized company

davoodmehraban89 committed Oct 20, 2026 at 08:45 UTC 32fa5bcd0a7a2c9e173bfa3053ff5a6b824e653b
1 file changed +2 -1
src/core/AuditService.js
+2 -1
@@ -103,7 +103,8 @@ class AuditServiceImpl {
103
104 async verifyChain({ companyId, anchor = null } = {}) {
105 if (!Auth.isAdmin()) throw new Error('بررسی زنجیره ممیزی فقط برای مدیر مجاز است');
106 - const target = companyId || await DataScope.companyId();
106 + const target = await DataScope.companyId();
107 + if (companyId && companyId !== target) throw new Error('بررسی ممیزی شرکت دیگر مجاز نیست');
108 const rows = await StorageService.getAllByIndex('audit_events', 'companyId', target);
109 return checkAuditChain(rows.sort((a,b) => (a.chainIndex ?? 0) - (b.chainIndex ?? 0)), anchor);
110 }