mirror of
https://github.com/grafana/grafana.git
synced 2025-07-28 09:22:20 +08:00
Plugins: Simplify plugin file removal (#66115)
* make explicit class check when attempting to remove plugin * simplify plugin file tracking * fix test * apply feedback * fix linter
This commit is contained in:
@ -22,7 +22,6 @@ import (
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/plugins/backendplugin"
|
||||
"github.com/grafana/grafana/pkg/plugins/repo"
|
||||
"github.com/grafana/grafana/pkg/plugins/storage"
|
||||
ac "github.com/grafana/grafana/pkg/services/accesscontrol"
|
||||
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
|
||||
"github.com/grafana/grafana/pkg/services/datasources"
|
||||
@ -491,10 +490,6 @@ func (hs *HTTPServer) UninstallPlugin(c *contextmodel.ReqContext) response.Respo
|
||||
if errors.Is(err, plugins.ErrUninstallCorePlugin) {
|
||||
return response.Error(http.StatusForbidden, "Cannot uninstall a Core plugin", err)
|
||||
}
|
||||
if errors.Is(err, storage.ErrUninstallOutsideOfPluginDir) {
|
||||
return response.Error(http.StatusForbidden, "Cannot uninstall a plugin outside of the plugins directory", err)
|
||||
}
|
||||
|
||||
return response.Error(http.StatusInternalServerError, "Failed to uninstall plugin", err)
|
||||
}
|
||||
return response.JSON(http.StatusOK, []byte{})
|
||||
|
Reference in New Issue
Block a user