mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 01:37:31 +00:00
fix: combine resourceowner query in reduce function for user grant (#7383)
* fix: projection reduce correction with unit tests * fix: remove eventcout variable as not used anymore * fix: add errors if resoureowner is not found in user grants reduce
This commit is contained in:
@@ -126,6 +126,12 @@ func (p *projectGrantMemberProjection) reduceAdded(event eventstore.Event) (*han
|
||||
}
|
||||
ctx := setMemberContext(e.Aggregate())
|
||||
userOwner, _, grantedOrg, err := getResourceOwners(ctx, p.es, e.Aggregate().InstanceID, e.UserID, e.Aggregate().ID, e.GrantID)
|
||||
if userOwner == "" {
|
||||
return nil, zerrors.ThrowNotFound(nil, "PROJ-cuvy6nu1tq", "Errors.NotFound")
|
||||
}
|
||||
if grantedOrg == "" {
|
||||
return nil, zerrors.ThrowNotFound(nil, "PROJ-i178hq18k4", "Errors.NotFound")
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user