feat(manager): staff permission editor, signed-in sessions, approvals log (platform-v2 2.6e)

- Staff: the 13 perm_* tick columns become one Permissions column (count,
  "changed from role") opening an editor grouped by module, from
  /api/waiters/permission-catalog: switches labelled per key, keys you don't
  hold are disabled with the reason, reset to role defaults (names what it
  can't give), save the whole set; access.cannot_grant explained by label.
- "Signed in now" (/management/sessions): who, where (app or device), since,
  last active, your own session marked; end session; show ended + reason.
- "Manager approvals" (/management/approvals): the override audit with
  action label, asked by, approved by, device, used/not used, order link.
- Backend: sessions list adds device_name/device_app/current/expires_at;
  overrides list adds device_name/expires_at.
- Permission labels for every key in modules.json (en/el), guarded by
  test_module_texts; manager unit tests for the editor logic; e2e 66 checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-14 08:10:57 +02:00
co-authored by Claude Opus 5.5
parent cc00ec39c7
commit 92bc1b0113
20 changed files with 1135 additions and 189 deletions
+1
View File
@@ -87,6 +87,7 @@ def test_waiter_cancels_after_manager_pin(client, db, venue, login):
assert err(client.get("/api/access/overrides", headers=v["waiter_h"])) == "access.denied"
listed = client.get("/api/access/overrides", headers=login(v["manager"])).json()
assert listed[0]["approved_by_name"] == v["manager"].full_name and listed[0]["target"] == f"order:{v['order'].id}"
assert listed[0]["expires_at"].endswith("Z") and listed[0]["device_name"] is None # 2.6e: names the device when there is one
def test_token_is_bound_to_its_key(client, db, venue, make_user, login):