* Access Control: Add folder service dependency to the dashboard/folder resolvers
* Expose the function fetching parents to folder interface
* Add generic prepend utility
* Modify dashboard resolvers to return inherited scopes
* Guardian: Use dashboard UID instead of ID
* Apply suggestions from code review
Introduce several guardian constructors and each time use
the most appropriate one.
* block move operation that could introduce more than 8 level of depth, forbid circular reference
* move getHeight to store, mock store in service
* fix linter
* Fix deleting subfolder
It used to fail with beause of missing signed in user
* Add logging
* fixup
* Fail request if deleting nested folder has failed
Before we only used to log the error
* Fix failing test
During failed nested folder creation
call the dashboard store deletion instead of the service one.
* Nested Folders: Do not refer to the configuration for checking for the flag
Use always features.IsEnabled() instead
* Depend on the interface instead
* add db migration at service start time
* make changes for the 3 db
* revert migrator
* fix feature toggle check
Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>
* Nested Folders: Support getting of nested folder in folder service when feature flag is set
* Fix lint
* Fix some tests
* Fix ngalert test
* ngalert fix
* Fix API tests
* Fix some tests and lint
* Fix lint 2
* Fix library elements and panels
* Add access control to get folder
* Cleanup and minor test change
* transfer DeleteFolder changes from larger PR
* finish some thingies
* add the simplest delete logics
* some intermedia steps
* fix tests
* add test
* fix some comments
Co-authored-by: yangkb09 <yangkb09@gmail.com>
* Folder: Add folder service implementation
* Add Move
* Add tests
* Add new servie method and adjust Update, Delete and Move
* Remove contains
* GetTree return children of depth one
* clean up and document integration test convention
* clarify integration test conventions
* clean up integration tests that don't follow convention
* mark testIntegration* functions as helpers to avoid confusion
* feat(nested folders): add CountDashboardsInFolder
This commit adds a new method to the Dashboard service and stores: CountDashboardsInFolder. The command struct takes a folderUID, but the store implementation still depends on the parent folder ID. This is temporary; eventually we will replace all references to FolderIDs (associated with Dashboards) with folder UIDs.
There are some unfortunate additional test changes that were necessary after generating the service & store mocks; it looks like that hasn't been generated since the last change(s).
* more test updates
* don't forget the service test
* that didn't end up used, so bye for now
* agree to disagree with the linter
* Add implementation for folder store methods
* Add Move implementation
* Add back comment and fix query
* Remove Move from store
* Adjust GetChildren
* Fix errutil error declaration and usage
* Add org id to get children query