sudo87 commented on code in PR #12294:
URL: https://github.com/apache/cloudstack/pull/12294#discussion_r2634636909


##########
plugins/api/discovery/src/main/java/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java:
##########
@@ -280,12 +283,22 @@ public ListResponse<? extends BaseResponse> listApis(User 
user, String name) {
                         
ReflectionToStringBuilderUtils.reflectOnlySelectedFields(account, 
"accountName", "uuid")));
             }
 
-            if (role.getRoleType() == RoleType.Admin && role.getId() == 
RoleType.Admin.getId()) {
-                logger.info(String.format("Account [%s] is Root Admin, all 
APIs are allowed.",
-                        
ReflectionToStringBuilderUtils.reflectOnlySelectedFields(account, 
"accountName", "uuid")));
+            // Limit APIs on first login requiring password change
+            UserAccount userAccount = 
accountService.getUserAccountById(user.getId());
+            Map<String, String> userAccDetails = userAccount.getDetails();
+            if (MapUtils.isNotEmpty(userAccDetails)) {

Review Comment:
   thanks @vishesh92 for pointing it out, will fix the logic



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to