Skip to content

Commit

Permalink
Code review sugestions
Browse files Browse the repository at this point in the history
  • Loading branch information
tcsc committed Dec 12, 2024
1 parent 37cebf4 commit b93e6ee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -5130,7 +5130,7 @@ func (a *Server) CreateAccessRequestV2(ctx context.Context, req types.AccessRequ
}

// Look for user groups and associated applications to the request.
requestedResourceIDs, err := a.appendAdditionalResources(ctx, req.GetRequestedResourceIDs())
requestedResourceIDs, err := a.appendImplicitlyRequiredResources(ctx, req.GetRequestedResourceIDs())
if err != nil {
return nil, trace.Wrap(err, "adding additional implicitly required resources")
}
Expand Down Expand Up @@ -5285,6 +5285,9 @@ func (a *Server) appendImplicitlyRequiredResources(ctx context.Context, resource

icAccounts := utils.NewSet[string]()
for _, resource := range accountAssignments {
// The UI needs access to the account associated with an Account Assignment
// in order to display the enclosing Account, otherwise the user will not
// be able to see their assigned permission sets.
assignmentID := services.IdentityCenterAccountAssignmentID(resource.Name)
asmt, err := a.Services.IdentityCenter.GetAccountAssignment(ctx, assignmentID)
if err != nil {
Expand All @@ -5299,7 +5302,6 @@ func (a *Server) appendImplicitlyRequiredResources(ctx context.Context, resource
ClusterName: resource.ClusterName,
Kind: types.KindIdentityCenterAccount,
Name: asmt.GetSpec().GetAccountId(),
}),
})
icAccounts.Add(asmt.GetSpec().GetAccountId())
}
Expand Down

0 comments on commit b93e6ee

Please sign in to comment.