Chore: Remove dashboard ACL from models (#61749)

* Remove dashboard ACL from models

* Remove unused comment
This commit is contained in:
idafurjes
2023-01-20 14:58:47 +01:00
committed by GitHub
parent c106c7700b
commit 68445a7c77
34 changed files with 452 additions and 451 deletions
+8 -8
View File
@@ -282,7 +282,7 @@ func TestIntegrationUserDataAccess(t *testing.T) {
})
require.Nil(t, err)
err = updateDashboardACL(t, ss, 1, &models.DashboardACL{
err = updateDashboardACL(t, ss, 1, &dashboards.DashboardACL{
DashboardID: 1, OrgID: users[0].OrgID, UserID: users[1].ID,
Permission: models.PERMISSION_EDIT,
})
@@ -421,7 +421,7 @@ func TestIntegrationUserDataAccess(t *testing.T) {
})
require.Nil(t, err)
err = updateDashboardACL(t, ss, 1, &models.DashboardACL{
err = updateDashboardACL(t, ss, 1, &dashboards.DashboardACL{
DashboardID: 1, OrgID: users[0].OrgID, UserID: users[1].ID,
Permission: models.PERMISSION_EDIT,
})
@@ -431,7 +431,7 @@ func TestIntegrationUserDataAccess(t *testing.T) {
err = userStore.Delete(context.Background(), users[1].ID)
require.Nil(t, err)
permQuery := &models.GetDashboardACLInfoListQuery{DashboardID: 1, OrgID: users[0].OrgID}
permQuery := &dashboards.GetDashboardACLInfoListQuery{DashboardID: 1, OrgID: users[0].OrgID}
err = userStore.getDashboardACLInfoList(permQuery)
require.Nil(t, err)
@@ -455,7 +455,7 @@ func TestIntegrationUserDataAccess(t *testing.T) {
})
require.Nil(t, err)
err = updateDashboardACL(t, ss, 1, &models.DashboardACL{
err = updateDashboardACL(t, ss, 1, &dashboards.DashboardACL{
DashboardID: 1, OrgID: users[0].OrgID, UserID: users[1].ID,
Permission: models.PERMISSION_EDIT,
})
@@ -487,7 +487,7 @@ func TestIntegrationUserDataAccess(t *testing.T) {
err = userStore.Delete(context.Background(), users[1].ID)
require.Nil(t, err)
permQuery = &models.GetDashboardACLInfoListQuery{DashboardID: 1, OrgID: users[0].OrgID}
permQuery = &dashboards.GetDashboardACLInfoListQuery{DashboardID: 1, OrgID: users[0].OrgID}
err = userStore.getDashboardACLInfoList(permQuery)
require.Nil(t, err)
@@ -818,7 +818,7 @@ func createFiveTestUsers(t *testing.T, svc user.Service, fn func(i int) *user.Cr
}
// TODO: Use FakeDashboardStore when org has its own service
func updateDashboardACL(t *testing.T, sqlStore db.DB, dashboardID int64, items ...*models.DashboardACL) error {
func updateDashboardACL(t *testing.T, sqlStore db.DB, dashboardID int64, items ...*dashboards.DashboardACL) error {
t.Helper()
err := sqlStore.WithDbSession(context.Background(), func(sess *db.Session) error {
@@ -855,9 +855,9 @@ func updateDashboardACL(t *testing.T, sqlStore db.DB, dashboardID int64, items .
// This function was copied from pkg/services/dashboards/database to circumvent
// import cycles. When this org-related code is refactored into a service the
// tests can the real GetDashboardACLInfoList functions
func (ss *sqlStore) getDashboardACLInfoList(query *models.GetDashboardACLInfoListQuery) error {
func (ss *sqlStore) getDashboardACLInfoList(query *dashboards.GetDashboardACLInfoListQuery) error {
outerErr := ss.db.WithDbSession(context.Background(), func(dbSession *db.Session) error {
query.Result = make([]*models.DashboardACLInfoDTO, 0)
query.Result = make([]*dashboards.DashboardACLInfoDTO, 0)
falseStr := ss.dialect.BooleanStr(false)
if query.DashboardID == 0 {