File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -271,9 +271,16 @@ async def write_value(
271271 else : # user, unbekannt oder sonstige → 401
272272 raise HTTPException (status .HTTP_401_UNAUTHORIZED , detail = "Authentication required" )
273273 else :
274- # Benutzer ist eingeloggt — prüfe ob er Zugang zur Seite hat
274+ # Benutzer ist eingeloggt — Admins dürfen immer schreiben.
275+ user_row = await db .fetchone ("SELECT is_admin FROM users WHERE username = ?" , (user ,))
276+ is_admin = bool (user_row and user_row ["is_admin" ])
277+
275278 page_id = request .headers .get ("X-Page-Id" )
276- if page_id :
279+ if not page_id and not is_admin :
280+ raise HTTPException (status .HTTP_401_UNAUTHORIZED , detail = "Authentication required" )
281+
282+ # Für nicht-Admins: ACL der referenzierten Seite erzwingen.
283+ if page_id and not is_admin :
277284 access = await _resolve_page_access (db , page_id )
278285 if access == "user" :
279286 from obs .api .v1 .visu import _check_user_access
You can’t perform that action at this time.
0 commit comments