From e197bb9526aaf849d2e1533ed299cc6e9f2a7bc9 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 12 Mar 2026 04:51:25 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20applyRoleRestrictions=20was=20called=20b?= =?UTF-8?q?ut=20never=20defined=20=E2=80=94=20was=20causing=20Error=20load?= =?UTF-8?q?ing=20request?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/dealspace.db-shm | Bin 32768 -> 32768 bytes data/dealspace.db-wal | Bin 98912 -> 131872 bytes portal/templates/app/request.html | 20 ++++++++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/data/dealspace.db-shm b/data/dealspace.db-shm index cb3a3464716bb903ec3db7bf675e5990d0e6eb4c..dd338dac997653f8b5a70db7b5f0efed6239c19b 100644 GIT binary patch delta 226 zcmZo@U}|V!s+V}A%K!o_K+MR%AfN!GrvvftbtwnE!sffaeHC8#Yul-se=Bb6fAJ}6 zI;rY`MuC9>ko=DXAfgOR3=$I?(|JvRTx}rM0b<>aSGU@;Gcs^62r@`*-std`iBWpv z$L~z+%nV!%!VEGSKgx1#J{53>i&c_Ao#EooWxIv|+Ol;}0fQW(F<> fVW5~i*XC0JcesFp9P*RbRk1;2*%){k#K1ZLF4{u1 diff --git a/data/dealspace.db-wal b/data/dealspace.db-wal index d99758956cf1e1a7560a83391dacd85a67b7f400..b51ced78cc1e2b58651912d3bf9a972d1dfdb6a2 100644 GIT binary patch delta 754 zcmaFR!nUA|qhSkULeq4QB1Qp@=~HgRMelz2ZhJxz<5^Zl&h2^?j7D6OPZS97_bl0Q zo9FDNtGo;h46Ctd#J7?D=SBGlDTPOijkSFg^`h|u1Tta zg>GVsWs1XeZ3;+n`Ixw4HXAf5aBFHXhcXglq3rfhS;lS_ z{xH#be==X5F$5dP+dBQdBBMGJZ|i28iJ`oc_s%6AJ@_Bm;vqC0CY4 zUdHMA6^stsBRqkg=il4(fpe>lqdeG3uKvmK2lZLFc5wA??mHODHF;OG2BXqs#W;=a z0{F%G4rEmjM9m)Z`fe delta 11 ScmZ3`#_^zqtzipeLK6TT#00Pa diff --git a/portal/templates/app/request.html b/portal/templates/app/request.html index c740fdc..617715c 100644 --- a/portal/templates/app/request.html +++ b/portal/templates/app/request.html @@ -134,6 +134,26 @@ let currentData = null; let currentAnswers = []; + async function applyRoleRestrictions() { + try { + const res = await fetchAPI('/api/auth/me'); + if (!res.ok) return; + const me = await res.json(); + const role = me.test_role || ''; + const isReadOnly = role === 'buyer' || role === 'seller' || role === 'advisor'; + if (isReadOnly) { + const ua = document.getElementById('uploadArea'); + if (ua) ua.style.display = 'none'; + const mb = document.getElementById('markAnsweredBtn'); + if (mb) mb.style.display = 'none'; + const eb = document.getElementById('editReqBtn'); + if (eb) eb.style.display = 'none'; + const cc = document.getElementById('commentComposer'); + if (cc) cc.style.display = 'none'; + } + } catch(e) {} + } + async function loadAll() { try { const res = await fetchAPI('/api/requests/' + reqID);