فینورا پرو - سامانه جامع حسابداری و صدور فاکتور
fix(A06): enforce admin authorization before backup export and data wipe
davoodmehraban89 committed
Oct 14, 2026 at 22:23 UTC
91bd4ab6ef722cef7312aedb2361a313f3db9312
1 file changed
+2
src/controllers/SettingsController.js
+2
@@ -28,6 +28,7 @@ class SettingsControllerImpl {
28
// بکاپگیری
29
// ============================================================
30
async exportBackup() {
31
+ if (!Auth.isAdmin()) throw new Error('تهیه فایل پشتیبان فقط توسط مدیر مجاز است');
32
const user = Auth.current();
33
if (!user) throw new Error('کاربر یافت نشد');
34
@@ -161,6 +162,7 @@ class SettingsControllerImpl {
162
// پاک کردن همهی دادهها
163
// ============================================================
164
async wipeAll() {
165
+ if (!Auth.isAdmin()) throw new Error('حذف اطلاعات فقط توسط مدیر مجاز است');
166
await StorageService.clearAll();
167
// sessionStorage و localStorage تمیز
168
sessionStorage.clear();