Skip to content

Commit

Permalink
fix: system admin does not have access to resources (#796)
Browse files Browse the repository at this point in the history
Signed-off-by: Kenta Kozuka <[email protected]>
  • Loading branch information
kentakozuka authored Feb 6, 2024
1 parent 5390f16 commit 57dc14a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/auth/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,18 +383,18 @@ func (s *authService) generateToken(
}
return nil, dt.Err()
}
adminRole := accountproto.Account_UNASSIGNED
if hasSystemAdminOrganization(resp.Organizations) {
adminRole = accountproto.Account_OWNER
}
idToken := &token.IDToken{
Issuer: claims.Iss,
Subject: claims.Sub,
Audience: claims.Aud,
Expiry: time.Unix(claims.Exp, 0),
IssuedAt: time.Unix(claims.Iat, 0),
Email: claims.Email,
AdminRole: adminRole,
AdminRole: accountproto.Account_UNASSIGNED,
}
if hasSystemAdminOrganization(resp.Organizations) {
idToken.IsSystemAdmin = true
idToken.AdminRole = accountproto.Account_OWNER
}
signedIDToken, err := s.signer.Sign(idToken)
if err != nil {
Expand Down

0 comments on commit 57dc14a

Please sign in to comment.