Unified: Replace user.SignedInUser with StaticRequester in apistore perm tests (#104257)

This commit is contained in:
Matheus Macabu
2025-04-22 10:47:09 +03:00
committed by GitHub
parent ca36d77f5b
commit 7c8433fbb2
@@ -11,7 +11,6 @@ import (
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1"
"github.com/grafana/grafana/pkg/apimachinery/identity"
"github.com/grafana/grafana/pkg/apimachinery/utils"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/storage/unified/resource"
)
@@ -63,7 +62,8 @@ func TestAfterCreatePermissionCreator(t *testing.T) {
})
t.Run("should succeed for user identity", func(t *testing.T) {
ctx := identity.WithRequester(context.Background(), &user.SignedInUser{
ctx := identity.WithRequester(context.Background(), &identity.StaticRequester{
Type: authtypes.TypeUser,
OrgID: 1,
OrgRole: "Admin",
UserID: 1,
@@ -85,7 +85,8 @@ func TestAfterCreatePermissionCreator(t *testing.T) {
})
t.Run("should succeed for service account identity", func(t *testing.T) {
ctx := identity.WithRequester(context.Background(), &user.SignedInUser{
ctx := identity.WithRequester(context.Background(), &identity.StaticRequester{
Type: authtypes.TypeServiceAccount,
OrgID: 1,
OrgRole: "Admin",
UserID: 1,