feat(idaa): trusted/admin users always get Jitsi moderator role

Rather than hardcoding the IDAA admins group UUID or making an extra
API call, re-use the access level already established by the IDAA layout.
If $ae_loc.trusted_access is set (verified against novi_trusted_li /
novi_admin_li), the user is a moderator immediately. Only regular
authenticated members fall through to the group membership check.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-03-27 14:52:31 -04:00
parent 27f0bd21fb
commit b88a7de358

View File

@@ -477,9 +477,16 @@ async function fetch_novi_data() {
} }
} }
// Moderator group check: prefer the g_uuid passed per-meeting in the URL (more precise), // Trusted/admin users are always moderators — the IDAA layout already verified
// fall back to the global novi_idaa_group_guid_li from site config for older Novi pages // this UUID against novi_trusted_li / novi_admin_li (from site config) and set
// that haven't been updated to pass g_uuid yet. // $ae_loc.trusted_access. Re-using that result avoids a redundant API call.
if ($ae_loc.trusted_access) {
is_moderator = true;
console.log(`Jitsi: User ${user_id} is moderator via trusted/admin access level.`);
} else {
// For regular authenticated members, check the specific meeting group.
// Prefer g_uuid from URL (per-meeting, more precise); fall back to the global
// novi_idaa_group_guid_li list for older Novi pages not yet passing g_uuid.
const group_uuid = url_params.g_uuid ?? null; const group_uuid = url_params.g_uuid ?? null;
const group_guid_li = group_uuid const group_guid_li = group_uuid
? [group_uuid] ? [group_uuid]
@@ -502,9 +509,10 @@ async function fetch_novi_data() {
is_moderator = true; is_moderator = true;
console.log(`Jitsi: User ${user_id} is a moderator.`); console.log(`Jitsi: User ${user_id} is a moderator.`);
} else { } else {
is_moderator = false; // Explicitly set to false if not in the set is_moderator = false;
console.log(`Jitsi: User ${user_id} is not a moderator.`); console.log(`Jitsi: User ${user_id} is not a moderator.`);
} }
}
} else { } else {
console.warn( console.warn(
'Jitsi: Novi API not configured. Using URL fallback for user details/moderator check.' 'Jitsi: Novi API not configured. Using URL fallback for user details/moderator check.'