Remove yarn warnings from portal-ui (#1207)

Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
This commit is contained in:
Lenin Alevski
2021-11-10 09:47:47 -08:00
committed by GitHub
parent c2f0889ff8
commit e82103c678
11 changed files with 61 additions and 47 deletions

View File

@@ -85,17 +85,6 @@ func getSessionResponse(session *models.Principal) (*models.SessionResponse, *mo
return nil, prepareError(err, errorGenericInvalidSession)
}
userAdminClient := AdminClient{Client: mAdminClient}
// Policy used by the current user
accountInfo, err := userAdminClient.AccountInfo(ctx)
if err != nil {
return nil, prepareError(err)
}
var sessionPolicy *models.IamPolicy
err = json.Unmarshal(accountInfo.Policy, &sessionPolicy)
if err != nil {
return nil, prepareError(err)
}
// Obtain the current policy assigned to this user
// necessary for generating the list of allowed endpoints
policy, err := getAccountPolicy(ctx, userAdminClient)
@@ -110,7 +99,15 @@ func getSessionResponse(session *models.Principal) (*models.SessionResponse, *mo
if policy != nil {
actions = acl.GetActionsStringFromPolicy(policy)
}
rawPolicy, err := json.Marshal(policy)
if err != nil {
return nil, prepareError(err, errorGenericInvalidSession)
}
var sessionPolicy *models.IamPolicy
err = json.Unmarshal(rawPolicy, &sessionPolicy)
if err != nil {
return nil, prepareError(err)
}
sessionResp := &models.SessionResponse{
Pages: acl.GetAuthorizedEndpoints(actions),
Features: getListOfEnabledFeatures(),