Commit Graph

163 Commits

Author SHA1 Message Date
Arati R.
e399fe6d09
Folders: Set folder creation permission as part of legacy create (#94040)
* Add folder store to dashboard permissions
* Include folder store in annotation scope resolver
* Add folder store when initialising library elements
* Include folder store in search v2 service initialisation
* Include folder store in GetInheritedScopes
* Add folder store to folder permissions provider
* Include cfg, folder permissions in folder service
* Move setting of folder permissions for folder service create method
2024-10-01 14:03:02 +02:00
Arati R.
ed75aea21d
Folders: Export folder store implementation (#93897)
* Export folder store implementation

* Rename folder store

* Add folder store as a parameter to folder service

* Add folder store to dash service implementation

* Fix folder store comments
2024-09-30 10:28:47 +02:00
Matheus Macabu
fcb17379ea
LibraryElements: add fake service implementation and replace its usage in Dashboard API (#93783)
* LibraryElements: add fake service implementation

* Dashboards: replace fake LibraryElements implementation
2024-09-27 14:22:29 +02:00
Matheus Macabu
40bcd0df41
LibraryElements: export GetAllElements to service (#93782) 2024-09-27 08:48:56 +02:00
Jeff Levin
a21a232a8e
Revert read replica POC (#93551)
* Revert "chore: add replDB to team service (#91799)"

This reverts commit c6ae2d7999.

* Revert "experiment: use read replica for Get and Find Dashboards (#91706)"

This reverts commit 54177ca619.

* Revert "QuotaService: refactor to use ReplDB for Get queries (#91333)"

This reverts commit 299c142f6a.

* Revert "refactor replCfg to look more like plugins/plugin config (#91142)"

This reverts commit ac0b4bb34d.

* Revert "chore (replstore): fix registration with multiple sql drivers, again (#90990)"

This reverts commit daedb358dd.

* Revert "Chore (sqlstore): add validation and testing for repl config (#90683)"

This reverts commit af19f039b6.

* Revert "ReplStore: Add support for round robin load balancing between multiple read replicas (#90530)"

This reverts commit 27b52b1507.

* Revert "DashboardStore: Use ReplDB and get dashboard quotas from the ReadReplica (#90235)"

This reverts commit 8a6107cd35.

* Revert "accesscontrol service read replica (#89963)"

This reverts commit 77a4869fca.

* Revert "Fix: add mapping for the new mysqlRepl driver (#89551)"

This reverts commit ab5a079bcc.

* Revert "fix: sql instrumentation dual registration error (#89508)"

This reverts commit d988f5c3b0.

* Revert "Experimental Feature Toggle: databaseReadReplica (#89232)"

This reverts commit 50244ed4a1.
2024-09-25 15:21:39 -08:00
Matheus Macabu
40ce035ed7
LibraryElements: remove viewer check when connecting a dashboard on General folder (#93737) 2024-09-25 16:16:59 +02:00
kay delaney
cbf2aa993e
LibraryPanels: Fix folderUid nil pointer dereference (#93400) 2024-09-17 13:03:49 +00:00
Alexander Akhmetov
b2eeb0dd6e
Alerting: update rule versions on folder move (#88376)
* Alerting: update rule versions on folder move (#88361)
* Add tracing to folder.Move and folder.Update
2024-08-13 12:26:26 +02:00
Karl Persson
bcfb66b416
Identity: remove GetTypedID (#91745) 2024-08-09 18:20:24 +03:00
Ieva
2e2ddc5c42
Folders: Allow folder editors and admins to create subfolders without any additional permissions (#91215)
* separate permissions for root level folder creation and subfolder creation

* fix tests

* fix tests

* fix tests

* frontend fix

* Update pkg/api/accesscontrol.go

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>

* fix frontend when action sets are disabled

---------

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
2024-08-01 18:20:38 +03:00
Ryan McKinley
be7b1ce2df
Chore: Replace appcontext.User(ctx) with identity.GetRequester(ctx) (#91030) 2024-07-26 16:39:23 +03:00
Ryan McKinley
9db3bc926e
Identity: Rename "namespace" to "type" in the requester interface (#90567) 2024-07-25 12:52:14 +03:00
Kristin Laemmert
8a6107cd35
DashboardStore: Use ReplDB and get dashboard quotas from the ReadReplica (#90235)
* Use ReplDB in dashboard store and update all fixtures - no other changes

* just moving dashboard counts for now

* find the missing test fixture
2024-07-12 10:47:49 -04:00
Alexander Zobnin
87d86e81ce
Zanzana: Evaluate permissions alongside with RBAC engine (#90064)
* Zanzana: Evaluate permissions if feature flag enabled

* Fix tests

* adjust logs

* fix spelling

* remove unused

* only evaluate implemented resources

* refactor
2024-07-05 11:31:23 +02:00
Ryan McKinley
27e800768e
K8s: Improve identity mapping setup (#89450) 2024-06-20 17:53:07 +03:00
Ryan McKinley
99d8025829
Chore: Move identity and errutil to apimachinery module (#89116) 2024-06-13 07:11:35 +03:00
kay delaney
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
Ieva
167151b211
Chore: Remove use of deprecated method in AC code (#87541)
* switch from using cfg to using featuremgmt for checking a feature toggle in AC code

* merge test fixes
2024-05-10 11:56:52 +01:00
Dan Cech
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
Serge Zaitsev
ad5613d7d4
Chore: Remove cfg from folder service (#87212)
remove cfg from folder service
2024-05-02 13:18:54 +02:00
Karl Persson
a2cba3d0b5
User: Add tracing (#87028)
* Inject tracer in tests

* Annotate with traces

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2024-04-30 13:15:56 +02:00
Serge Zaitsev
522a98c126
Chore: Make Cfg field private in SQLStore (#85593)
* make cfg private in sqlstore

* fix db init in tests

* fix case

* fix folder test init

* fix imports

* make another Cfg private

* remove another Cfg

* remove unused variable

* use store cfg, it has side-effects

* fix mutated cfg in tests
2024-04-24 10:38:40 +02:00
idafurjes
5c4a2de59b
Add FolderUID for library elements (#83819)
* Revert "Revert "Add FolderUID for library elements" (#83776)"

This reverts commit 0dfdb2ae47.

* 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
kay delaney
6a53864f7a
LibraryPanelRBAC: Fix issue with importing dashboards containing library panels (#83980) 2024-04-05 10:11:02 +01:00
Gilles De Mey
8765c48389
Alerting: Remove legacy alerting (#83671)
Removes legacy alerting, so long and thanks for all the fish! 🐟

---------

Co-authored-by: Matthew Jacobson <matthew.jacobson@grafana.com>
Co-authored-by: Sonia Aguilar <soniaAguilarPeiron@users.noreply.github.com>
Co-authored-by: Armand Grillet <armandgrillet@users.noreply.github.com>
Co-authored-by: William Wernert <rwwiv@users.noreply.github.com>
Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
2024-03-14 15:36:35 +01:00
owensmallwood
0dfdb2ae47
Revert "Add FolderUID for library elements" (#83776)
Revert "Add FolderUID for library elements (#79572)"

This reverts commit 2532047e7a.
2024-03-01 18:16:43 +02:00
idafurjes
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
김은빈
96dfb385ca
Grafana: Replace magic number with a constant variable in response status (#80132)
* Chore: Replace response status with const var

* Apply suggestions from code review

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

* Add net/http import

---------

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2024-02-27 18:39:51 +02:00
Serge Zaitsev
d0679f0993
Chore: Add support bundle for folders (#83360)
* add support bundle for folders

* fix ProvideService in tests

* add a test for collector
2024-02-26 11:27:22 +01:00
kay delaney
82e3e2e558
LibraryPanels/RBAC: Fix issue where folder scopes weren't being correctly inherited (#82700) 2024-02-16 14:17:41 +00:00
Dan Cech
790e1feb93
Chore: Update test database initialization (#81673)
* streamline initialization of test databases, support on-disk sqlite test db

* clean up test databases

* introduce testsuite helper

* use testsuite everywhere we use a test db

* update documentation

* improve error handling

* disable entity integration test until we can figure out locking error
2024-02-09 09:35:39 -05:00
idafurjes
7e5544ab21
Add MFolderIDsServiceCount to count folderIDs in services pkg (#81237) 2024-01-25 11:10:35 +01:00
Marcus Efraimsson
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
Dan Cech
d76defe517
K8s: Move GrafanaMetaAccessor into grafana-apiserver and remove usage of kinds metadata (#79602)
* move GrafanaMetaAccessor into pkg/apis, add support for Spec.Title & Spec.Name

* K8s: Move GrafanaMetaAccessor (PR into another) (#79728)

* access titles

* remove title

* remove title

* remove kinds metadata accessor

* remove kinds metadata accessor

* fixes

* error handling

* fix tests

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-01-12 16:18:14 -05:00
Alexander Zobnin
959ebf82da
Folders: Show dashboards and folders with directly assigned permissions in "Shared" folder (#78465)
* Folders: Show folders user has access to at the root level

* Refactor

* Refactor

* Hide parent folders user has no access to

* Skip expensive computation if possible

* Fix tests

* Fix potential nil access

* Fix duplicated folders

* Fix linter error

* Fix querying folders if no managed permissions set

* Update benchmark

* Add special shared with me folder and fetch available non-root folders on demand

* Fix parents query

* Improve db query for folders

* Reset benchmark changes

* Fix permissions for shared with me folder

* Simplify dedup

* Add option to include shared folder permission to user's permissions

* Fix nil UID

* Remove duplicated folders from shared list

* Folders: Fix fetching empty folder

* Nested folders: Show dashboards with directly assigned permissions

* Fix slow dashboards fetch

* Refactor

* Fix cycle dependencies

* Move shared folder to models

* Fix shared folder links

* Refactor

* Use feature flag for permissions

* Use feature flag

* Review comments

* Expose shared folder UID through frontend settings

* Add frontend type for sharedWithMeFolderUID option

* Refactor: apply review suggestions

* Fix parent uid for shared folder

* Fix listing shared dashboards for users with access to all folders

* Prevent creating folder with "shared" UID

* Add tests for shared folders

* Add test for shared dashboards

* Fix linter

* Add metrics for shared with me folder

* Add metrics for shared with me dashboards

* Fix tests

* Tests: add metrics as a dependency

* Fix access control metadata for shared with me folder

* Use constant for shared with me

* Optimize parent folders access check, fetch all folders in one query.

* Use labels for metrics
2023-12-05 16:13:31 +01:00
Julien Duchesne
cd584e9261
Swagger: Fix getLibraryElementByName response (#78221)
It returns an array of library elements, not a single one. This has been tested by generating the OpenAPI client and using it in Terraform
2023-12-04 11:20:13 -05: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
Kat Yang
2f2ce3edbb
Chore: Deprecate ID from Folder (#78281)
* Chore: Deprecate ID from Folder

* chore: add more linter comments

* chore: add missing lint comment
2023-11-20 15:44:51 -05:00
Kat Yang
8d581b8358
Chore: Deprecate ID in GetFolderQuery (#77647) 2023-11-15 10:30:00 -05:00
Kat Yang
3a2e96b0db
Chore: Deprecate FolderID from Dashboard (#77823)
* Chore: Deprecate FolderID from Dashboard

* chore: add two missing nolint comments
2023-11-15 10:28:50 -05:00
Ryan McKinley
f69fd3726b
FeatureToggles: Add context and and an explicit global check (#78081) 2023-11-14 12:50:27 -08:00
Ryan McKinley
3509a5abb9
FeatureFlags: Cleanup usage of cfg.IsFeatureToggleEnabled (#78014) 2023-11-13 07:55:15 -08:00
Kat Yang
911ffed45b
Chore: Deprecate FolderID in libraryElement struct in tests (#77473)
* Chore: Deprecate FolderID in LibraryElement struct in tests

* chore: revert formatting for deprecation comment
2023-11-06 11:31:15 -05:00
Kat Yang
2c7f364067
Chore: Deprecate FolderID in PatchLibraryElementCommand (#77472)
* Chore: Deprecate FolderID in PatchLibraryElementCommand

* chore: regen specs
2023-11-06 11:31:01 -05:00
Kat Yang
dd5314c6a8
Chore: Deprecate FolderID in LibraryElementDTO (#77471)
* Chore: Deprecate FolderID in LibraryElementDTO

* chore: fix formatting of deprecation comment

* chore: revert deprecation comment formatting

* chore: regen specs
2023-11-06 11:30:32 -05:00
Kat Yang
f40de8b613
Chore: Deprecate folderIDs in FolderFilter (#77590)
Chore: Deprecate FolderID in FolderFilter
2023-11-03 10:12:40 -04:00
Kat Yang
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
Kat Yang
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
Kat Yang
f7ce6f8b41
Chore: Deprecate FolderID in LibraryElementWithMeta (#77406) 2023-10-31 11:50:02 -04:00
Kat Yang
87717849da
Chore: Deprecate FolderID in GetLibraryElementCommand (#77404) 2023-10-31 11:46:48 -04:00