RBAC: Fix dashboard filter in SQLBuilder (#53379) (#53506)

* Reuse DasbhoardPermissionFilter

*  Use rbac dashboard filter if enabled

(cherry picked from commit aa484a60c9)
This commit is contained in:
Karl Persson
2022-08-10 11:58:12 +02:00
committed by GitHub
parent 8dd2b99c87
commit bb1b145ce8
7 changed files with 43 additions and 69 deletions
+1 -1
View File
@@ -141,7 +141,7 @@ func TestIntegrationAlertingDataAccess(t *testing.T) {
t.Run("Viewer can read alerts", func(t *testing.T) {
setup(t)
viewerUser := &models.SignedInUser{OrgRole: models.ROLE_VIEWER, OrgId: 1}
viewerUser := &models.SignedInUser{OrgRole: models.ROLE_VIEWER, OrgId: 1, Permissions: map[int64]map[string][]string{1: {"dashboards:read": []string{"dashboards:*"}}}}
alertQuery := models.GetAlertsQuery{DashboardIDs: []int64{testDash.Id}, PanelId: 1, OrgId: 1, User: viewerUser}
err2 := sqlStore.HandleAlertsQuery(context.Background(), &alertQuery)