fix: agent permission erlaubt firmware + agents endpoints fuer rmm-updater OTA

This commit is contained in:
cynfo3000 2026-03-10 01:08:14 +01:00
parent 1923b28fa2
commit 1c7c82dfac

View File

@ -129,10 +129,13 @@ func hasAPIKeyPermission(key *db.APIKey, r *http.Request) bool {
switch perm {
case "agent":
// Nur Agent-Endpunkte: Registrierung, WS-Connect, Heartbeat
// Agent-Endpunkte: Registrierung, WS-Connect, Heartbeat, OTA-Update
return path == "/api/v1/agent/ws" ||
path == "/api/v1/agent/heartbeat" ||
path == "/api/v1/agent/register"
path == "/api/v1/agent/register" ||
path == "/api/v1/firmware" ||
path == "/api/v1/firmware/download" ||
strings.HasPrefix(path, "/api/v1/agents/")
case "read":
// Nur GET-Requests, keine destruktiven Aktionen