diff --git a/routers/web/repo/actions/view.go b/routers/web/repo/actions/view.go index 903ff2632..abef5325f 100644 --- a/routers/web/repo/actions/view.go +++ b/routers/web/repo/actions/view.go @@ -579,11 +579,6 @@ func ArtifactsView(ctx *context_module.Context) { } func ArtifactsDeleteView(ctx *context_module.Context) { - if !ctx.Repo.CanWrite(unit.TypeActions) { - ctx.Error(http.StatusForbidden, "no permission") - return - } - runIndex := ctx.ParamsInt64("run") artifactName := ctx.Params("artifact_name") diff --git a/routers/web/web.go b/routers/web/web.go index 0684b2ac8..f4d657fb7 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -1401,7 +1401,7 @@ func registerRoutes(m *web.Route) { m.Post("/approve", reqRepoActionsWriter, actions.Approve) m.Post("/artifacts", actions.ArtifactsView) m.Get("/artifacts/{artifact_name}", actions.ArtifactsDownloadView) - m.Delete("/artifacts/{artifact_name}", actions.ArtifactsDeleteView) + m.Delete("/artifacts/{artifact_name}", reqRepoActionsWriter, actions.ArtifactsDeleteView) m.Post("/rerun", reqRepoActionsWriter, actions.Rerun) }) })