mirror of
https://github.com/zitadel/zitadel.git
synced 2025-03-01 00:37:24 +00:00
fix: return my org on zitadel permission (#441)
This commit is contained in:
parent
4fa68ae2ee
commit
1b59a52f26
@ -62,7 +62,21 @@ func (repo *UserGrantRepo) SearchMyProjectOrgs(ctx context.Context, request *gra
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return grantRespToOrgResp(grants), nil
|
if len(grants.Result) > 0 {
|
||||||
|
return grantRespToOrgResp(grants), nil
|
||||||
|
}
|
||||||
|
user, err := repo.View.UserByID(ctxData.UserID)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
org, err := repo.View.OrgByID(user.ResourceOwner)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &grant_model.ProjectOrgSearchResponse{Result: []*grant_model.Org{&grant_model.Org{
|
||||||
|
OrgID: org.ID,
|
||||||
|
OrgName: org.Name,
|
||||||
|
}}}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (repo *UserGrantRepo) SearchMyZitadelPermissions(ctx context.Context) ([]string, error) {
|
func (repo *UserGrantRepo) SearchMyZitadelPermissions(ctx context.Context) ([]string, error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user