mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-18 03:15:11 +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. <[email protected]>
This commit is contained in:
@@ -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