abh1sar commented on code in PR #9741:
URL: https://github.com/apache/cloudstack/pull/9741#discussion_r1794630249


##########
server/src/main/java/com/cloud/api/ApiServer.java:
##########
@@ -874,6 +875,34 @@ private void buildAuditTrail(final StringBuilder 
auditTrailSb, final String comm
         }
     }
 
+    protected boolean verifyApiKeyAccessAllowed(User user, Account account) {
+        Boolean apiKeyAccessEnabled = user.getApiKeyAccess();
+        if (apiKeyAccessEnabled != null) {
+            if (apiKeyAccessEnabled == true) {

Review Comment:
   Done



##########
server/src/main/java/com/cloud/api/ApiServer.java:
##########
@@ -874,6 +875,34 @@ private void buildAuditTrail(final StringBuilder 
auditTrailSb, final String comm
         }
     }
 
+    protected boolean verifyApiKeyAccessAllowed(User user, Account account) {
+        Boolean apiKeyAccessEnabled = user.getApiKeyAccess();
+        if (apiKeyAccessEnabled != null) {
+            if (apiKeyAccessEnabled == true) {
+                return true;
+            } else {
+                logger.info("Api-Key access is disabled for the User");

Review Comment:
   Done



##########
server/src/main/java/com/cloud/api/ApiServer.java:
##########
@@ -874,6 +875,34 @@ private void buildAuditTrail(final StringBuilder 
auditTrailSb, final String comm
         }
     }
 
+    protected boolean verifyApiKeyAccessAllowed(User user, Account account) {
+        Boolean apiKeyAccessEnabled = user.getApiKeyAccess();
+        if (apiKeyAccessEnabled != null) {
+            if (apiKeyAccessEnabled == true) {
+                return true;
+            } else {
+                logger.info("Api-Key access is disabled for the User");
+                return false;
+            }
+        }
+        apiKeyAccessEnabled = account.getApiKeyAccess();
+        if (apiKeyAccessEnabled != null) {
+            if (apiKeyAccessEnabled == true) {
+                return true;
+            } else {
+                logger.info("Api-Key access is disabled for the Account");
+                return false;
+            }
+        }
+        apiKeyAccessEnabled = apiKeyAccess.valueIn(account.getDomainId());
+        if (apiKeyAccessEnabled == true) {
+                return true;
+        } else {
+            logger.info("Api-Key access is disabled by the Domain level 
setting");

Review Comment:
   Done



-- 
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