Chore: Move identity and errutil to apimachinery module (#89116)
This commit is contained in:
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/grafana/grafana/pkg/apimachinery/identity"
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/models/roletype"
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
ac "github.com/grafana/grafana/pkg/services/accesscontrol"
|
||||
"github.com/grafana/grafana/pkg/services/accesscontrol/acimpl"
|
||||
@@ -411,7 +411,7 @@ func TestAddAppLinksAccessControl(t *testing.T) {
|
||||
Type: "page",
|
||||
AddToNav: true,
|
||||
DefaultNav: true,
|
||||
Role: roletype.RoleEditor,
|
||||
Role: identity.RoleEditor,
|
||||
Action: catalogReadAction,
|
||||
},
|
||||
{
|
||||
@@ -419,7 +419,7 @@ func TestAddAppLinksAccessControl(t *testing.T) {
|
||||
Path: "/a/test-app1/page2",
|
||||
Type: "page",
|
||||
AddToNav: true,
|
||||
Role: roletype.RoleViewer,
|
||||
Role: identity.RoleViewer,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -445,7 +445,7 @@ func TestAddAppLinksAccessControl(t *testing.T) {
|
||||
t.Run("Should not add app links when the user cannot access app plugins", func(t *testing.T) {
|
||||
treeRoot := navtree.NavTreeRoot{}
|
||||
user.Permissions = map[int64]map[string][]string{}
|
||||
user.OrgRole = roletype.RoleAdmin
|
||||
user.OrgRole = identity.RoleAdmin
|
||||
|
||||
err := service.addAppLinks(&treeRoot, reqCtx)
|
||||
require.NoError(t, err)
|
||||
@@ -456,7 +456,7 @@ func TestAddAppLinksAccessControl(t *testing.T) {
|
||||
user.Permissions = map[int64]map[string][]string{
|
||||
1: {pluginaccesscontrol.ActionAppAccess: []string{"*"}},
|
||||
}
|
||||
user.OrgRole = roletype.RoleEditor
|
||||
user.OrgRole = identity.RoleEditor
|
||||
|
||||
err := service.addAppLinks(&treeRoot, reqCtx)
|
||||
require.NoError(t, err)
|
||||
@@ -472,7 +472,7 @@ func TestAddAppLinksAccessControl(t *testing.T) {
|
||||
user.Permissions = map[int64]map[string][]string{
|
||||
1: {pluginaccesscontrol.ActionAppAccess: []string{"*"}},
|
||||
}
|
||||
user.OrgRole = roletype.RoleViewer
|
||||
user.OrgRole = identity.RoleViewer
|
||||
|
||||
err := service.addAppLinks(&treeRoot, reqCtx)
|
||||
require.NoError(t, err)
|
||||
@@ -487,7 +487,7 @@ func TestAddAppLinksAccessControl(t *testing.T) {
|
||||
user.Permissions = map[int64]map[string][]string{
|
||||
1: {pluginaccesscontrol.ActionAppAccess: []string{"*"}, catalogReadAction: []string{}},
|
||||
}
|
||||
user.OrgRole = roletype.RoleViewer
|
||||
user.OrgRole = identity.RoleViewer
|
||||
service.features = featuremgmt.WithFeatures(featuremgmt.FlagAccessControlOnCall)
|
||||
|
||||
err := service.addAppLinks(&treeRoot, reqCtx)
|
||||
@@ -504,7 +504,7 @@ func TestAddAppLinksAccessControl(t *testing.T) {
|
||||
user.Permissions = map[int64]map[string][]string{
|
||||
1: {pluginaccesscontrol.ActionAppAccess: []string{"*"}},
|
||||
}
|
||||
user.OrgRole = roletype.RoleEditor
|
||||
user.OrgRole = identity.RoleEditor
|
||||
service.features = featuremgmt.WithFeatures(featuremgmt.FlagAccessControlOnCall)
|
||||
|
||||
err := service.addAppLinks(&treeRoot, reqCtx)
|
||||
|
||||
Reference in New Issue
Block a user