Revert "RBAC: remove dashboard ACL logic from dash store, service #78130 (#78198)

Revert "RBAC: remove dashboard ACL logic from dash store and service (#78130)"

This reverts commit dd54931147.
This commit is contained in:
Eric Leijonmarck
2023-11-15 13:33:38 +00:00
committed by GitHub
parent 384db8e0ca
commit 8057b9298d
14 changed files with 926 additions and 27 deletions
@@ -1183,6 +1183,21 @@ func insertTestDashboardForPlugin(t *testing.T, dashboardStore dashboards.Store,
return dash
}
func updateDashboardACL(t *testing.T, dashboardStore dashboards.Store, dashboardID int64,
items ...dashboards.DashboardACL) error {
t.Helper()
var itemPtrs []*dashboards.DashboardACL
for _, it := range items {
item := it
item.Created = time.Now()
item.Updated = time.Now()
itemPtrs = append(itemPtrs, &item)
}
return dashboardStore.UpdateDashboardACL(context.Background(), dashboardID, itemPtrs)
}
// testSearchDashboards is a (near) copy of the dashboard service
// SearchDashboards, which is a wrapper around FindDashboards.
func testSearchDashboards(d dashboards.Store, query *dashboards.FindPersistedDashboardsQuery) (model.HitList, error) {