Chore: Remove dashboard ACL from models (#61749)
* Remove dashboard ACL from models * Remove unused comment
This commit is contained in:
@@ -65,7 +65,7 @@ func TestIntegrationDashboardFolderDataAccess(t *testing.T) {
|
||||
|
||||
t.Run("and acl is set for dashboard folder", func(t *testing.T) {
|
||||
var otherUser int64 = 999
|
||||
err := updateDashboardACL(t, dashboardStore, folder.ID, models.DashboardACL{
|
||||
err := updateDashboardACL(t, dashboardStore, folder.ID, dashboards.DashboardACL{
|
||||
DashboardID: folder.ID,
|
||||
OrgID: 1,
|
||||
UserID: otherUser,
|
||||
@@ -86,7 +86,7 @@ func TestIntegrationDashboardFolderDataAccess(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("when the user is given permission", func(t *testing.T) {
|
||||
err := updateDashboardACL(t, dashboardStore, folder.ID, models.DashboardACL{
|
||||
err := updateDashboardACL(t, dashboardStore, folder.ID, dashboards.DashboardACL{
|
||||
DashboardID: folder.ID, OrgID: 1, UserID: currentUser.ID, Permission: models.PERMISSION_EDIT,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -129,7 +129,7 @@ func TestIntegrationDashboardFolderDataAccess(t *testing.T) {
|
||||
var otherUser int64 = 999
|
||||
err := updateDashboardACL(t, dashboardStore, folder.ID)
|
||||
require.NoError(t, err)
|
||||
err = updateDashboardACL(t, dashboardStore, childDash.ID, models.DashboardACL{
|
||||
err = updateDashboardACL(t, dashboardStore, childDash.ID, dashboards.DashboardACL{
|
||||
DashboardID: folder.ID, OrgID: 1, UserID: otherUser, Permission: models.PERMISSION_EDIT,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -145,7 +145,7 @@ func TestIntegrationDashboardFolderDataAccess(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("when the user is given permission to child", func(t *testing.T) {
|
||||
err := updateDashboardACL(t, dashboardStore, childDash.ID, models.DashboardACL{
|
||||
err := updateDashboardACL(t, dashboardStore, childDash.ID, dashboards.DashboardACL{
|
||||
DashboardID: childDash.ID, OrgID: 1, UserID: currentUser.ID, Permission: models.PERMISSION_EDIT,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -224,7 +224,7 @@ func TestIntegrationDashboardFolderDataAccess(t *testing.T) {
|
||||
|
||||
t.Run("and acl is set for one dashboard folder", func(t *testing.T) {
|
||||
const otherUser int64 = 999
|
||||
err := updateDashboardACL(t, dashboardStore, folder1.ID, models.DashboardACL{
|
||||
err := updateDashboardACL(t, dashboardStore, folder1.ID, dashboards.DashboardACL{
|
||||
DashboardID: folder1.ID, OrgID: 1, UserID: otherUser, Permission: models.PERMISSION_EDIT,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -265,7 +265,7 @@ func TestIntegrationDashboardFolderDataAccess(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("and a dashboard with an acl is moved to the folder without an acl", func(t *testing.T) {
|
||||
err := updateDashboardACL(t, dashboardStore, childDash1.ID, models.DashboardACL{
|
||||
err := updateDashboardACL(t, dashboardStore, childDash1.ID, dashboards.DashboardACL{
|
||||
DashboardID: childDash1.ID, OrgID: 1, UserID: otherUser, Permission: models.PERMISSION_EDIT,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -363,7 +363,7 @@ func TestIntegrationDashboardFolderDataAccess(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("Should have write access to one dashboard folder if default role changed to view for one folder", func(t *testing.T) {
|
||||
err := updateDashboardACL(t, dashboardStore, folder1.ID, models.DashboardACL{
|
||||
err := updateDashboardACL(t, dashboardStore, folder1.ID, dashboards.DashboardACL{
|
||||
DashboardID: folder1.ID, OrgID: 1, UserID: editorUser.ID, Permission: models.PERMISSION_VIEW,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -409,7 +409,7 @@ func TestIntegrationDashboardFolderDataAccess(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("Should be able to get one dashboard folder if default role changed to edit for one folder", func(t *testing.T) {
|
||||
err := updateDashboardACL(t, dashboardStore, folder1.ID, models.DashboardACL{
|
||||
err := updateDashboardACL(t, dashboardStore, folder1.ID, dashboards.DashboardACL{
|
||||
DashboardID: folder1.ID, OrgID: 1, UserID: viewerUser.ID, Permission: models.PERMISSION_EDIT,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -442,7 +442,7 @@ func TestIntegrationDashboardFolderDataAccess(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("and admin permission is given for user with org role viewer in one dashboard folder", func(t *testing.T) {
|
||||
err := updateDashboardACL(t, dashboardStore, folder1.ID, models.DashboardACL{
|
||||
err := updateDashboardACL(t, dashboardStore, folder1.ID, dashboards.DashboardACL{
|
||||
DashboardID: folder1.ID, OrgID: 1, UserID: viewerUser.ID, Permission: models.PERMISSION_ADMIN,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -458,7 +458,7 @@ func TestIntegrationDashboardFolderDataAccess(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("and edit permission is given for user with org role viewer in one dashboard folder", func(t *testing.T) {
|
||||
err := updateDashboardACL(t, dashboardStore, folder1.ID, models.DashboardACL{
|
||||
err := updateDashboardACL(t, dashboardStore, folder1.ID, dashboards.DashboardACL{
|
||||
DashboardID: folder1.ID, OrgID: 1, UserID: viewerUser.ID, Permission: models.PERMISSION_EDIT,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user