82 Commits

Author SHA1 Message Date
bc231922af Library panels: Remove libraryPanelRBAC feature flag, and enable rbac by default (#107222) 2025-06-27 08:09:02 +00:00
79fe8a9902 Library Panels: Modify connection api endpoint to be compatible with unified storage (#107088) 2025-06-25 22:21:56 +00:00
f4e4ba6f19 Library elements: Remove ability to set as "library variable" (#106594) 2025-06-12 08:41:18 -05:00
fd6a4908f1 Support Spanner's UNION syntax, which needs to be UNION DISTINCT or UNION ALL. (#101768)
* Support Spanner's UNION syntax, which needs to be UNION DISTINCT or UNION ALL.
2025-03-10 12:33:52 +01:00
67be9aeed6 K8s: Search fallback: Support all sort by methods (#100776) 2025-02-18 12:30:11 -06:00
df64dd0762 LibraryElements: Propagate service identity in context when searching for dashboards (#100220)
* Propagate service identity in context when searching for dashboards
2025-02-13 09:17:16 +01:00
495aa65c6e FindDashboards: filter by dashboard type (#100160) 2025-02-05 18:57:26 -06:00
39d94eabcd Auth: Fix function name (#100122)
Fix spelling
2025-02-05 15:32:22 +01:00
61c5b4a25e Library elements: remove usage of dashboard table on get (#99619) 2025-01-27 17:39:18 -06:00
078ce6a289 Library elements: Delete orphaned connections with the dashboard service (#99612) 2025-01-27 22:37:38 +02:00
7ebe599389 Library elements: do not error if dashboard is not found (#99608) 2025-01-27 20:35:30 +02:00
abe2a5370d Use dashboards service to query for dashboard uid when getting library elements (#99369) 2025-01-27 14:42:57 +01:00
0003efa285 Library Panels: Remove dashboards table dependency when getting all library panels (#99160)
* Remove dashboards table dependency when getting all library panels
* Filter library elements a user can see using the folder service
* Stop using folder name as UID in get all elements tests
* Set actual folder name not UID when getting all elements
* Stop selecting folder name in the get all elements sql query
* Introduce a library elements param selector without where clause
* Include empty string as general folder UID when getting all library elements

---------

Co-authored-by: suntala <arati.rana@grafana.com>
2025-01-27 10:51:41 +01:00
fb3a858726 Revert "Remove dependency on dashboards table to get library element and library element connection" (#99213)
Revert "Remove dependency on dashboards table to get library element and libr…"

This reverts commit 32790c691843a0af7a6a273f04dcae30ba4689b0.
2025-01-17 21:43:14 +02:00
2bce8c5e29 Folders: Use folder UID instead of folder ID in query for getting library elements (#99028) 2025-01-17 16:04:11 +01:00
a0d1a197e3 Folders: Use folder UID when deleting library elements in folder (#98967)
* Refactor  deleteLibraryElementsInFolderUID to use folder UID only
* Convert dashboard error to folder one when deleting library elements
* Fix incorrectly set folder UID in nested folder test

---------

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
2025-01-17 12:04:02 +01:00
32790c6918 Remove dependency on dashboards table to get library element and library element connection (#98941)
* Remove dependency on dashboards table to get library element

* WIP

* Don't use dashboard id when getting library connections

* Lint

* Don;t include folder_uid in library element
2025-01-15 10:32:24 +01:00
90035f9786 Remove permissions call which would get folders again (#98729)
* Remove permissions call which would get folders again

* Remove comment
2025-01-09 18:45:20 +01:00
4f2d8a1a3b Remove access to folders directly from library elements service (#98665)
* Remove access to folders directly from library elements service

* Lint

* Remove unwanted comment
2025-01-09 11:03:04 +02:00
cbf2aa993e LibraryPanels: Fix folderUid nil pointer dereference (#93400) 2024-09-17 13:03:49 +00:00
bcfb66b416 Identity: remove GetTypedID (#91745) 2024-08-09 18:20:24 +03:00
9db3bc926e Identity: Rename "namespace" to "type" in the requester interface (#90567) 2024-07-25 12:52:14 +03:00
99d8025829 Chore: Move identity and errutil to apimachinery module (#89116) 2024-06-13 07:11:35 +03:00
8f45003192 LibraryPanels/RBAC: Ignore old folder permission check when deleting/patching lib panel (#88422)
* LibraryPanels/RBAC: Ignore old folder permission check when deleting lib panel

* Same for patching
2024-05-30 12:23:20 +01:00
41bee274fd Chore: Fix error handling in postDashboard, remove UserDisplayDTO, fix live redis client initialization (#87206)
* clean up error handling in postDashboard and remove UserDisplayDTO

* replace GetUserUID with GetUID and GetNamespacedUID, enforce namespace constant type

* lint fix

* lint fix

* more lint fixes
2024-05-06 14:17:34 -04:00
5c4a2de59b Add FolderUID for library elements (#83819)
* Revert "Revert "Add FolderUID for library elements" (#83776)"

This reverts commit 0dfdb2ae47383beb41aa981313b4f12b4b29a8fa.

* Fix bug, dashboard id and library element fodler_id are the corresponding values
Dashboard table hold both dahboards and tables
2024-04-09 12:27:43 +02:00
6a53864f7a LibraryPanelRBAC: Fix issue with importing dashboards containing library panels (#83980) 2024-04-05 10:11:02 +01:00
0dfdb2ae47 Revert "Add FolderUID for library elements" (#83776)
Revert "Add FolderUID for library elements (#79572)"

This reverts commit 2532047e7a6f2bd4ac9b7d7ae3d1b2aadcfb3bd6.
2024-03-01 18:16:43 +02:00
2532047e7a Add FolderUID for library elements (#79572)
* Add FolderUID in missing places for libraryelements

* Add migration for FolderUID in library elements table

* Add Folder UIDs tolibrary panels

* Adjust dashboard import with folder uid

* Fix lint

* Rename back FolderUID to UID

* Remove default

* Check if folderUID is nil

* Add unique indes on org_id,folder_uid,name and kind

* Update pkg/services/libraryelements/database.go

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Fix folder integration test, with unique index on library elements

* Make folder uids nullable and rewrite migration query

* Use dashboard uid instead of folder_uid

* Adjust test

---------

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2024-03-01 10:16:33 +01:00
82e3e2e558 LibraryPanels/RBAC: Fix issue where folder scopes weren't being correctly inherited (#82700) 2024-02-16 14:17:41 +00:00
7e5544ab21 Add MFolderIDsServiceCount to count folderIDs in services pkg (#81237) 2024-01-25 11:10:35 +01:00
6768c6c059 Chore: Remove public vars in setting package (#81018)
Removes the public variable setting.SecretKey plus some other ones. 
Introduces some new functions for creating setting.Cfg.
2024-01-23 12:36:22 +01:00
Jo
0de66a8099 Authz: Remove use of SignedInUser copy for permission evaluation (#78448)
* remove use of SignedInUserCopies

* add extra safety to not cross assign permissions

unwind circular dependency

dashboardacl->dashboardaccess

fix missing import

* correctly set teams for permissions

* fix missing inits

* nit: check err

* exit early for api keys
2023-11-22 14:20:22 +01:00
f69fd3726b FeatureToggles: Add context and and an explicit global check (#78081) 2023-11-14 12:50:27 -08:00
254648b96b Chore: Deprecate FolderID in CreateLibraryElementComand (#77403)
* Chore: Deprecate FolderID in CreateLibraryElementComand

* chore: add remaining nolint comments

* chore: regen specs to include deprecation notice
2023-10-31 13:24:16 -04:00
f9b21083c6 Chore: Deprecate FolderID in LibraryElement struct (#77377)
* Chore: Deprecate FolderID in LibraryElement struct

* chore: format deprecated comment

* chore: add remaining nolint comments
2023-10-31 13:02:53 -04:00
f7ce6f8b41 Chore: Deprecate FolderID in LibraryElementWithMeta (#77406) 2023-10-31 11:50:02 -04:00
87717849da Chore: Deprecate FolderID in GetLibraryElementCommand (#77404) 2023-10-31 11:46:48 -04:00
b04a014341 Chore: Fix failure when importing dashboard (#76947) 2023-10-23 18:16:46 +03:00
a12cb8cbf3 LibraryPanels: Add RBAC support (#73475) 2023-10-12 00:30:50 +01:00
Jo
342af2d078 Identity: Port Annotations and Analytics to Identity.Requester (#76104)
* Port analytics to requester

* Port annotations to identity.Request
2023-10-06 11:38:20 +02:00
13f4382214 Auth: Implement requester interface in access control module (#74289)
* Implement requester interface in the access control module
2023-09-06 11:16:10 +02:00
025b2f3011 Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
427714f8d0 Export: Remove DS input when dashboard is imported with a lib panel that already exists (#69412) 2023-07-27 13:11:15 -03:00
20ffbbc41e NestedFolders: Add library panels counting and deletion to folder registry (#69149)
* Expose library element service's folder service
* Register library panels, add count implementation
* Expand folder counts test
* Update registry deletion method interface
* Allow getting library elements from any folder
* Add test for library panel deletion
* Add test for library panel counting
2023-07-25 13:05:53 +02:00
ee73d41d24 PublicDashboards: Audit table pagination (#69823) 2023-06-21 10:48:09 -03:00
a37bf1ac2a RBAC: Update library element tests to use RBAC (#66782)
* update library element tests to use RBAC

* update bits of code to use RBAC

* update library panel tests

* linting

* more linting

* and more linting

* PR feedback
2023-04-20 12:24:41 +03:00
fda38de293 Library panels: Ensure pagination controls are always correctly displayed (#65283)
correctly count library panels in the general folder
2023-04-11 14:16:20 +01:00
988a120d6d Search v1: Add support for inherited folder permissions if nested folders are enabled (#63275)
* Add features dependency to SQLBuilder

* Add features dependency to AccessControlDashboardPermissionFilter

* Add test for folder inheritance

* Dashboard permissions: Return recursive query

* Recursive query for inherited folders

* Modify search builder

* Adjust db.SQLBuilder

* Pass flag to SQLbuilder if CTEs are supported

* Add support for mysql < 8.0

* Add benchmarking for search with nested folders

* Set features to AlertStore

* Update pkg/infra/db/sqlbuilder.go

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

* Set features to LibraryElementService

* SQLBuilder tests with nested folder flag set

* Apply suggestion from code review

Co-authored-by: IevaVasiljeva <ieva.vasiljeva@grafana.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2023-04-06 11:16:15 +03:00
2c50c44d89 Chore: Move library elements models to library elements service (#62507)
* Chore: Move library elements models to library elements service

* Fix stat import

* Fix faulty error assignment
2023-02-01 17:32:05 +01:00