Add read-only permission overview ("Eigene Rechte anzeigen")

Partial progress on #71 (full permissions editor). A genuine full
editor - server/channel/group permission grids across 5 permission
scopes with add/remove/modify for hundreds of possible permissions -
is a much bigger undertaking than fits in one pass, so this lands a
real, useful slice of it first: a read-only view of the caller's own
effective permissions in their current channel.

- Connector: "permoverview" (raw command, no typed builder exists)
  requests the caller's effective permission set for cid+cldbid.
  Permission IDs are opaque numeric values server-side, so results are
  name-resolved via a "permissionlist" id->name/description lookup
  that's fetched once and cached for the connection's lifetime. The two
  requests are chained (list first, overview second) with buffering in
  case the overview reply somehow arrives first.
- Gateway: typed passthrough for the merged, name-resolved entries.
- Frontend: new dialog wired to "Eigene Rechte anzeigen" in the Rechte
  menu (previously disabled) - a filterable table of permission
  name/value/negated/skip.

Verified against the real server: initially got a clean
"ParameterNotFound" error revealing that permoverview needs an
explicit permid=0 ("all permissions") even though tsclientlib's
generated type treats it as optional; after adding that argument the
command reaches the server correctly and returns the expected
permission-denied response for the guest test account (same pattern
as every other admin-gated feature this session).

The remaining scope of #71 - editable server-group/channel-group/
channel/client permission grids - is unchanged and left for later.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
MoepchiandClaude Sonnet 5 committed 2026-08-05 21:35:09 +02:00
1 parent 0f8576ac6c
commit 41ac845fbc
7 files changed
+305 -3

No files matched your search

+17
View File
@@ -367,6 +367,23 @@ export class DemoSocket {
// No observable effect - the demo has no real ServerQuery backend to
// authenticate against.
break;
case "getPermissionOverview": {
this.after(400, () =>
this.emit({
type: "permissionOverview",
entries: [
{ name: "b_client_info_view", description: "View own client info", value: 1, negated: false, skip: false },
{ name: "b_client_permissionoverview_view", description: "View permission overview", value: 1, negated: false, skip: false },
{ name: "i_channel_join_power", description: "Power to join channels", value: 25, negated: false, skip: false },
{ name: "i_client_talk_power", description: "Talk power", value: 25, negated: false, skip: false },
{ name: "b_client_use_priority_speaker", description: "Use priority speaker", value: 0, negated: true, skip: false },
{ name: "i_client_max_channel_subscriptions", description: "Max channel subscriptions", value: -1, negated: false, skip: false },
{ name: "b_channel_join_permanent", description: "Join permanent channels", value: 1, negated: false, skip: false },
],
})
);
break;
}
// "disconnect" is intentionally unhandled here: handleDisconnect() in
// App.tsx always calls socket.close() right after sending it, and
// close() already emits the "disconnected" event below.