fix: handle default org id (#3769)

This commit is contained in:
Livio Amstutz
2022-06-03 14:30:39 +02:00
committed by GitHub
parent ebb73186b6
commit 0baaaf8a05
38 changed files with 331 additions and 158 deletions

View File

@@ -37,7 +37,7 @@ func (q *Queries) GetProjectMemberRoles(ctx context.Context) ([]string, error) {
return nil, err
}
roles := make([]string, 0)
global := authz.GetCtxData(ctx).OrgID == iam.GlobalOrgID
global := authz.GetCtxData(ctx).OrgID == iam.DefaultOrgID
for _, roleMap := range q.zitadelRoles {
if strings.HasPrefix(roleMap.Role, "PROJECT") && !strings.HasPrefix(roleMap.Role, "PROJECT_GRANT") {
if global && !strings.HasSuffix(roleMap.Role, "GLOBAL") {