function checkAdminAccess() { const loggedInUser = JSON.parse(sessionStorage.getItem("current_user")); if (!loggedInUser || loggedInUser.role !== "admin") { alert("Access Denied: Admins Only"); window.location.href = "index.html"; } } function promoteToAdmin(targetId) { if (targetId === 1) return; // Cannot modify karblock let data = JSON.parse(localStorage.getItem(DB_NAME)); const userIndex = data.users.findIndex(u => u.id === targetId); if (userIndex !== -1) { data.users[userIndex].role = "admin"; localStorage.setItem(DB_NAME, JSON.stringify(data)); location.reload(); } }