diff --git a/core/api.go b/core/api.go index 00f07425..2c01a6cd 100644 --- a/core/api.go +++ b/core/api.go @@ -26,7 +26,7 @@ func registerEvents() { func registerAPIEndpoints() error { if err := api.RegisterEndpoint(api.Endpoint{ Path: "core/shutdown", - Read: api.PermitSelf, + Write: api.PermitSelf, ActionFunc: shutdown, }); err != nil { return err @@ -34,7 +34,7 @@ func registerAPIEndpoints() error { if err := api.RegisterEndpoint(api.Endpoint{ Path: "core/restart", - Read: api.PermitAdmin, + Write: api.PermitAdmin, ActionFunc: restart, }); err != nil { return err diff --git a/resolver/api.go b/resolver/api.go index a14882ff..eb87623f 100644 --- a/resolver/api.go +++ b/resolver/api.go @@ -10,7 +10,7 @@ import ( func registerAPI() error { if err := api.RegisterEndpoint(api.Endpoint{ Path: "dns/clear", - Read: api.PermitUser, + Write: api.PermitUser, ActionFunc: clearNameCache, Name: "Clear cached DNS records", Description: "Deletes all saved DNS records from the database.", diff --git a/ui/api.go b/ui/api.go index e1f10d9a..d5d8e18b 100644 --- a/ui/api.go +++ b/ui/api.go @@ -9,7 +9,7 @@ import ( func registerAPIEndpoints() error { return api.RegisterEndpoint(api.Endpoint{ Path: "ui/reload", - Read: api.PermitUser, + Write: api.PermitUser, ActionFunc: reloadUI, }) } diff --git a/updates/api.go b/updates/api.go index c6aa2719..5a00216f 100644 --- a/updates/api.go +++ b/updates/api.go @@ -10,8 +10,8 @@ const ( func registerAPIEndpoints() error { return api.RegisterEndpoint(api.Endpoint{ - Path: apiPathCheckForUpdates, - Read: api.PermitUser, + Path: apiPathCheckForUpdates, + Write: api.PermitUser, ActionFunc: func(_ *api.Request) (msg string, err error) { if err := TriggerUpdate(); err != nil { return "", err