fix: hide webui user management when server in single-user mode

Single-root deployments reject /list-users with XAdminMethodNotSupported.
Treat that response as a capability signal so the dashboard suppresses
the expected error and removes unsupported user-management controls.
This commit is contained in:
Ben McClelland
2026-09-20 13:07:11 -07:00
parent d03ac3c299
commit 3db22f3d38
3 changed files with 52 additions and 5 deletions
+9
View File
@@ -419,10 +419,19 @@ under the License.
}
async function loadGatewayUsers() {
if (!api.canManageGatewayUsers()) return true;
let users;
try {
users = await api.listUsers();
} catch (error) {
if (error.code === 'XAdminMethodNotSupported') {
api.setCanManageGatewayUsers(false);
document.querySelectorAll('[data-admin-users-only]').forEach(item => {
item.style.display = 'none';
});
return true;
}
console.error('Error loading users:', error);
showToast('Error loading users: ' + error.message, 'error');
return false;