fix: zentrale Lebensmittel fuer Admins aenderbar
Persoenliche Liste bleibt beim Owner; zentrale Eintraege oeffnen den Admin-Editor. Admin-Katalog trennt beide Listen, persoenliche bleiben sichtbar. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
9a0767c8ac
commit
e452d9a8fe
13 files changed
+134
-45
No files matched your search
@@ -238,8 +238,8 @@ def get_food_detail(food_id: str, session: dict = Depends(require_auth)):
|
||||
if not food:
|
||||
raise HTTPException(404, "Lebensmittel nicht gefunden")
|
||||
food = dict(food)
|
||||
from data_layer.food_visibility import attach_visibility, same_id
|
||||
editable = food.get("catalog_kind") == "manual_user" and same_id(food.get("owner_profile_id"), pid)
|
||||
from data_layer.food_visibility import attach_visibility, can_edit_food
|
||||
editable = can_edit_food(food, pid, is_admin=session.get("role") == "admin")
|
||||
return attach_visibility(editor_payload_for_food(cur, food, editable=editable))
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user