* replace usage of folder guardians with access control evaluators
* remove NewByFolderUID guardian
* bring up to date
* fix test
* more test fixes, and don't fetch the folder before evaluating lib element access
* change what error is returned
* fix alerting test
* try to fix linter errors
* replace the use of newByFolder guardian with direct access control evaluator checks
* remove newByFolder guardian
* remove unintentional changes
* remove unintentional changes
* undo unwanted change
* Unistore: Declare a new storage to set default folder permissions
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Remove the setting of default permissions from folder legacy storage
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Disable setting of folder permissions when Api Server is enabled
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Reverts grafana/grafana#100019
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Add unit test
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* check error on unit test
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Add unit test
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Remove unused fields
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Add unit tests for folder_storage
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Remove duplicated import
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Fix unit test
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
---------
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Handle both user and service accounts when resolving identity name for dashboards and folders
Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
* Implement k8s count handler
* Fix endpoint
* Fix type converstions
* Add tests for foldercounts
* Add more tests
* Only use sql-fallback if no values in unistore
* Update gomod
* Fix test
* Update pkg/api/folder_test.go
Co-authored-by: Bruno Abrantes <bruno.abrantes@grafana.com>
* Go.mod
---------
Co-authored-by: Bruno Abrantes <bruno.abrantes@grafana.com>
* Add route for update folders via apiserver
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
---------
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
* Enable getting folders with kubernetes client
* Add TestIntegrationFolderGetPermissions
* Set full path as part of legacy get
* Replace implementation for setting fullpath
* Add folder get test
* Escape forward slash in parent titles
* Replace test for access control metadata
* Add test case to TestIntegrationFolderGetPermissions
* Improve fetching of access control
Adds more spans for timing in accesscontrol and remove permission deduplicating code after benchmarking
---------
Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
* Chore: Remove FolderID from DTO Folder
* chore: add OrgID field to an instance of SaveDashboardCommand
* chore: add another OrgID to pair with the FolderUID:
* chore: add OrgId to Folder struct and expectedParentOrgIDs to testCase struct, unsure if last part is necessary
* Fix folder test, add expected orgID
* chore: regen specs
---------
Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
* remove metadata for single folder listing
* extendTests
* remove ac metadata from dash and folder search results
* remove test
* remove one more test
* put ac metadata back for single folder API responses
* extend tests
* remove ac metadata from folder frontend object
* undo unneeded change
* PR feedback
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
---------
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
* Nested Folders: Fix move response
Fix JSON tags to be consistent with the GET endpoint
* Add API test for moving to root folder
* Allow move to root folder
* Fix failure message
* Update OpenAPI specification
* protect moving folders to a subfolder and creating folders in a subfolder
* folder update endpoint isn't used for folder parent update
* lint
* move permission check logic to services, fix tests
* linting
* add nested folder scope inheritance to managed permission services
* add a more specific erorr
* remove circular dependencies
* use errutil for returning erorr
* fix tests
* fix tests
* define a new error in ac package
* Guardian: Use dashboard UID instead of ID
* Apply suggestions from code review
Introduce several guardian constructors and each time use
the most appropriate one.
* 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>