fix: agent permission erlaubt firmware + agents endpoints fuer rmm-updater OTA
This commit is contained in:
parent
1923b28fa2
commit
1c7c82dfac
@ -129,10 +129,13 @@ func hasAPIKeyPermission(key *db.APIKey, r *http.Request) bool {
|
|||||||
|
|
||||||
switch perm {
|
switch perm {
|
||||||
case "agent":
|
case "agent":
|
||||||
// Nur Agent-Endpunkte: Registrierung, WS-Connect, Heartbeat
|
// Agent-Endpunkte: Registrierung, WS-Connect, Heartbeat, OTA-Update
|
||||||
return path == "/api/v1/agent/ws" ||
|
return path == "/api/v1/agent/ws" ||
|
||||||
path == "/api/v1/agent/heartbeat" ||
|
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":
|
case "read":
|
||||||
// Nur GET-Requests, keine destruktiven Aktionen
|
// Nur GET-Requests, keine destruktiven Aktionen
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user