fix: add user info to context for set metadata in actions (#10426)

# Which Problems Are Solved

User information in the context is necessary through the addition of the
resource based API endpoints for user metadata, for the permission
check.

# How the Problems Are Solved

Add user information to the action execution to add metadata to users.

# Additional Changes

None

# Additional Context

Needs to be added to v4 releases, to provide the functionality to add
metadata through actions v1 and actions v2 functions.

Co-authored-by: Marco A. <marco@zitadel.com>
(cherry picked from commit 1579bbc8db)
This commit is contained in:
Stefan Benz
2025-08-11 16:43:52 +02:00
committed by Livio Spring
parent 968fc694f9
commit bd6d4e35d4
10 changed files with 32 additions and 11 deletions

View File

@@ -0,0 +1,15 @@
package login
import (
"context"
"github.com/zitadel/zitadel/internal/api/authz"
"github.com/zitadel/zitadel/internal/domain"
)
func (l *Login) bulkSetUserMetadata(ctx context.Context, userID, orgID string, metadata []*domain.Metadata) error {
// user context necessary due to permission check in command
userCtx := authz.SetCtxData(ctx, authz.CtxData{UserID: userID, OrgID: orgID})
_, err := l.command.BulkSetUserMetadata(userCtx, userID, orgID, metadata...)
return err
}