LibraryPanels: Deletes library panels during folder deletion (#31572)

* Refactor: adds permissions for library panel creation

* Refactor: checks folder permissions for patch requests

* Chore: changes after PR comments

* Refactor: adds permissions to delete

* Refactor: moves get all permission tests out of get all tests

* Chore: move out get all tests to a separate file

* Refactor: adds permissions to get handler

* Refactor: fixes a bug with getting library panels in General folder

* Refactor: adds permissions for connect/disconnect

* Refactor: adds permissions and tests for get connected dashboards

* Tests: adds tests for connected dashboards in General Folder

* LibraryPanels: Deletes library panels during folder deletion

* LibraryPanels: Deletes library panels during folder deletion

* Update pkg/api/folder.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/services/librarypanels/librarypanels_permissions_test.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Chore: updates after PR comments

* Chore: forgot to change some function signatures

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Hugo Häggmark
2021-03-02 10:34:01 +01:00
committed by GitHub
parent e13a48166b
commit 4bc6a7c407
7 changed files with 127 additions and 2 deletions

View File

@@ -294,7 +294,7 @@ func (hs *HTTPServer) registerRoutes() {
folderRoute.Group("/:uid", func(folderUidRoute routing.RouteRegister) {
folderUidRoute.Get("/", routing.Wrap(GetFolderByUID))
folderUidRoute.Put("/", bind(models.UpdateFolderCommand{}), routing.Wrap(UpdateFolder))
folderUidRoute.Delete("/", routing.Wrap(DeleteFolder))
folderUidRoute.Delete("/", routing.Wrap(hs.DeleteFolder))
folderUidRoute.Group("/permissions", func(folderPermissionRoute routing.RouteRegister) {
folderPermissionRoute.Get("/", routing.Wrap(hs.GetFolderPermissionList))