فینورا پرو - سامانه جامع حسابداری و صدور فاکتور
fix(A03): support company-scoped history grants for full backups
davoodmehraban89 committed
Oct 19, 2026 at 18:44 UTC
9045b635534ad8c20d34b5f599f89d9bf26c4a1f
1 file changed
+5
-3
src/core/StorageService.js
+5
-3
@@ -436,9 +436,11 @@ class StorageServiceImpl {
436
437
await this.transaction(STORES, async tx => {
438
const auditRows = (json.data.audit_events || []).filter(item => !!item);
439
- if (auditRows.length) AuditService.authorizeRestore(tx, {
440
- companyId: auditRows[0].companyId, rows: auditRows
441
- });
439
+ for (const companyId of new Set(auditRows.map(row => row.companyId))) {
440
+ AuditService.authorizeRestore(tx, {
441
+ companyId, rows: auditRows.filter(row => row.companyId === companyId)
442
+ });
443
+ }
444
for (const store of STORES) {
445
const items = json.data[store];
446
if (!items) continue;