fix: user grant query with user organization instead of organization … (#10732)

…of project grant

# Which Problems Are Solved

On Management API the fields for `GrantedOrgId`, `GrantedOrgName` and
`GrantedOrgDomain` were only filled if it was a usergrant for a granted
project.

# How the Problems Are Solved

Correctly query the Organization of the User again to the Organization
the Project is granted to.
Then fill in the information about the Organization of the User in the
fields `GrantedOrgId`, `GrantedOrgName` and `GrantedOrgDomain`.

# Additional Changes

Additionally query the information about the Organization the Project is
granted to, to have it available for the Authorization v2beta API.

# Additional Context

Closes #10723

---------

Co-authored-by: Tim Möhlmann <[email protected]>
This commit is contained in:
Stefan Benz
2025-09-16 10:04:53 +00:00
committed by GitHub
co-authored by Tim Möhlmann
parent b0642a5898
commit edb227f066
3 changed files with 436 additions and 341 deletions
+3 -3
View File
@@ -39,9 +39,9 @@ func UserGrantToPb(assetPrefix string, grant *query.UserGrant) *user_pb.UserGran
AvatarUrl: domain.AvatarURL(assetPrefix, grant.UserResourceOwner, grant.AvatarURL),
PreferredLoginName: grant.PreferredLoginName,
UserType: TypeToPb(grant.UserType),
GrantedOrgId: grant.GrantedOrgID,
GrantedOrgName: grant.GrantedOrgName,
GrantedOrgDomain: grant.GrantedOrgDomain,
GrantedOrgId: grant.UserResourceOwner,
GrantedOrgName: grant.UserResourceOwnerName,
GrantedOrgDomain: grant.UserResourceOwnerDomain,
Details: object.ToViewDetailsPb(
grant.Sequence,
grant.CreationDate,