Rename Acl to ACL (#52342)
* Rename Acl to ACL * Fix yaml files * Add xorm tags and fix test
This commit is contained in:
@@ -54,7 +54,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, models.DashboardACL{
|
||||
DashboardID: folder.Id,
|
||||
OrgID: 1,
|
||||
UserID: otherUser,
|
||||
@@ -75,7 +75,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, models.DashboardACL{
|
||||
DashboardID: folder.Id, OrgID: 1, UserID: currentUser.ID, Permission: models.PERMISSION_EDIT,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -116,9 +116,9 @@ func TestIntegrationDashboardFolderDataAccess(t *testing.T) {
|
||||
|
||||
t.Run("and acl is set for dashboard child and folder has all permissions removed", func(t *testing.T) {
|
||||
var otherUser int64 = 999
|
||||
err := updateDashboardAcl(t, dashboardStore, folder.Id)
|
||||
err := updateDashboardACL(t, dashboardStore, folder.Id)
|
||||
require.NoError(t, err)
|
||||
err = updateDashboardAcl(t, dashboardStore, childDash.Id, models.DashboardAcl{
|
||||
err = updateDashboardACL(t, dashboardStore, childDash.Id, models.DashboardACL{
|
||||
DashboardID: folder.Id, OrgID: 1, UserID: otherUser, Permission: models.PERMISSION_EDIT,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -134,7 +134,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, models.DashboardACL{
|
||||
DashboardID: childDash.Id, OrgID: 1, UserID: currentUser.ID, Permission: models.PERMISSION_EDIT,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -211,7 +211,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, models.DashboardACL{
|
||||
DashboardID: folder1.Id, OrgID: 1, UserID: otherUser, Permission: models.PERMISSION_EDIT,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -252,7 +252,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, models.DashboardACL{
|
||||
DashboardID: childDash1.Id, OrgID: 1, UserID: otherUser, Permission: models.PERMISSION_EDIT,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -348,7 +348,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, models.DashboardACL{
|
||||
DashboardID: folder1.Id, OrgID: 1, UserID: editorUser.ID, Permission: models.PERMISSION_VIEW,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -394,7 +394,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, models.DashboardACL{
|
||||
DashboardID: folder1.Id, OrgID: 1, UserID: viewerUser.ID, Permission: models.PERMISSION_EDIT,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -427,7 +427,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, models.DashboardACL{
|
||||
DashboardID: folder1.Id, OrgID: 1, UserID: viewerUser.ID, Permission: models.PERMISSION_ADMIN,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -443,7 +443,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, models.DashboardACL{
|
||||
DashboardID: folder1.Id, OrgID: 1, UserID: viewerUser.ID, Permission: models.PERMISSION_EDIT,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user