shwstppr commented on a change in pull request #5854:
URL: https://github.com/apache/cloudstack/pull/5854#discussion_r788434487



##########
File path: 
plugins/api/rate-limit/src/main/java/org/apache/cloudstack/ratelimit/ApiRateLimitServiceImpl.java
##########
@@ -139,24 +139,33 @@ public boolean resetApiLimit(Long accountId) {
         return true;
     }
 
+    @Override
+    public boolean isEnabled() {
+        return enabled;
+    }
+
     @Override
     public boolean checkAccess(User user, String apiCommandName) throws 
PermissionDeniedException {
         // check if api rate limiting is enabled or not
         if (!enabled) {
             return true;
         }
-        Long accountId = user.getAccountId();
-        Account account = _accountService.getAccount(accountId);
+        Account account = _accountService.getAccount(user.getAccountId());
+        return checkAccessWithoutEnabledCheck(account, user, apiCommandName, 
null);
+    }
+
+    @Override
+    public boolean checkAccessWithoutEnabledCheck(Account account, User user, 
String apiCommandName, Role role) throws PermissionDeniedException {

Review comment:
       Can do but don't see particular benefit of that and will have to tinker 
the code (trace bit) that's working fine.




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