[v11.0.x] Access Control: Clean up permissions for deprovisioned data sources (#88700)

merge
This commit is contained in:
Ieva
2024-06-05 10:49:41 +03:00
committed by GitHub
parent 02699ea1af
commit dde92e457c
7 changed files with 89 additions and 68 deletions
@@ -123,7 +123,7 @@ func TestDatasourceAsConfig(t *testing.T) {
})
t.Run("Remove one datasource should have removed old datasource", func(t *testing.T) {
store := &spyStore{}
store := &spyStore{items: []*datasources.DataSource{{Name: "old-data-source", OrgID: 1, UID: "old-data-source"}}}
orgFake := &orgtest.FakeOrgService{}
correlationsStore := &mockCorrelationsStore{}
dc := newDatasourceProvisioner(logger, store, correlationsStore, orgFake)
@@ -140,7 +140,7 @@ func TestDatasourceAsConfig(t *testing.T) {
})
t.Run("Two configured datasource and purge others", func(t *testing.T) {
store := &spyStore{items: []*datasources.DataSource{{Name: "old-graphite", OrgID: 1, ID: 1}, {Name: "old-graphite2", OrgID: 1, ID: 2}}}
store := &spyStore{items: []*datasources.DataSource{{Name: "old-graphite", OrgID: 1, ID: 1}, {Name: "old-graphite3", OrgID: 1, ID: 2}}}
orgFake := &orgtest.FakeOrgService{}
correlationsStore := &mockCorrelationsStore{}
dc := newDatasourceProvisioner(logger, store, correlationsStore, orgFake)