diff --git a/internal/api/grpc/management/user_converter.go b/internal/api/grpc/management/user_converter.go index 96a26f6181..525eba9d89 100644 --- a/internal/api/grpc/management/user_converter.go +++ b/internal/api/grpc/management/user_converter.go @@ -373,7 +373,7 @@ func ListUserMembershipsRequestToModel(ctx context.Context, req *mgmt_pb.ListUse if err != nil { return nil, err } - ownerQuery, err := query.NewMembershipResourceOwnerQuery(authz.GetCtxData(ctx).OrgID) + ownerQuery, err := query.NewMembershipResourceOwnersSearchQuery(authz.GetInstance(ctx).InstanceID(), authz.GetCtxData(ctx).OrgID) if err != nil { return nil, err } diff --git a/internal/query/user.go b/internal/query/user.go index 7d722f14d4..6d3b39fda1 100644 --- a/internal/query/user.go +++ b/internal/query/user.go @@ -387,7 +387,7 @@ func (q *Queries) GetHumanProfile(ctx context.Context, userID string, withOwnerR UserInstanceIDCol.identifier(): authz.GetInstance(ctx).InstanceID(), } if !withOwnerRemoved { - addUserWithoutOwnerRemoved(eq) + eq[UserOwnerRemovedCol.identifier()] = false } stmt, args, err := query.Where(eq).ToSql() if err != nil { @@ -411,7 +411,7 @@ func (q *Queries) GetHumanEmail(ctx context.Context, userID string, withOwnerRem UserInstanceIDCol.identifier(): authz.GetInstance(ctx).InstanceID(), } if !withOwnerRemoved { - addUserWithoutOwnerRemoved(eq) + eq[UserOwnerRemovedCol.identifier()] = false } stmt, args, err := query.Where(eq).ToSql() if err != nil { @@ -435,7 +435,7 @@ func (q *Queries) GetHumanPhone(ctx context.Context, userID string, withOwnerRem UserInstanceIDCol.identifier(): authz.GetInstance(ctx).InstanceID(), } if !withOwnerRemoved { - addUserWithoutOwnerRemoved(eq) + eq[UserOwnerRemovedCol.identifier()] = false } stmt, args, err := query.Where(eq).ToSql() if err != nil { @@ -562,7 +562,7 @@ func (q *Queries) IsUserUnique(ctx context.Context, username, email, resourceOwn } eq := sq.Eq{UserInstanceIDCol.identifier(): authz.GetInstance(ctx).InstanceID()} if !withOwnerRemoved { - addUserWithoutOwnerRemoved(eq) + eq[UserOwnerRemovedCol.identifier()] = false } stmt, args, err := query.Where(eq).ToSql() if err != nil {