From 3610927a3338590483d46dd5ff87c77e26220872 Mon Sep 17 00:00:00 2001 From: pavlov346346-source Date: Tue, 15 Sep 2026 17:49:05 +0300 Subject: [PATCH] fix: restore write permissions in local-only mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RBAC permission checks (has()) always deferred to the cloud workspace's role, which is null when using "work locally without internet" — so every guarded action (save/delete order, edit catalog, etc.) was blocked with "no permission" even though there is no workspace to restrict against. Local-only mode now grants full access, matching how nav permissions already behave with no cloud session. Co-Authored-By: Claude Sonnet 5 --- public/app-runtime.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app-runtime.js b/public/app-runtime.js index 9d17313..386d02c 100644 --- a/public/app-runtime.js +++ b/public/app-runtime.js @@ -3334,7 +3334,7 @@ window.SUN_LEGACY_CATALOG_V175=[{"id":"1","name":"Фуршетный бокс function workspace(){ return cloud()?.getWorkspace?.() || null; } function session(){ return cloud()?.getSession?.() || null; } function client(){ return cloud()?.getClient?.() || null; } - function has(p){ const c=cloud(); return c?.hasPermission ? c.hasPermission(p) : false; } + function has(p){ try{if(localStorage.getItem('sunLocalOnlyModeV1')==='1')return true;}catch(_){} const c=cloud(); return c?.hasPermission ? c.hasPermission(p) : false; } function currentPermissions(){ return workspace()?.permissions || {}; } function normalizeLegacyLocalAuth(){