Files
zitadel/internal/api/ui/login/metadata.go
T
1579bbc8db 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. <[email protected]>
2025-08-11 16:43:52 +02:00

16 lines
483 B
Go

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
}