mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-06 19:36:41 +00:00
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:
committed by
Livio Spring
parent
968fc694f9
commit
bd6d4e35d4
15
internal/api/ui/login/metadata.go
Normal file
15
internal/api/ui/login/metadata.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user