rhtyd commented on a change in pull request #1996: CLOUDSTACK-9099: SecretKey 
is returned from the APIs
URL: https://github.com/apache/cloudstack/pull/1996#discussion_r115656568
 
 

 ##########
 File path: server/src/com/cloud/user/AccountManagerImpl.java
 ##########
 @@ -2632,4 +2651,27 @@ public void checkAccess(Account account, DiskOffering 
dof)
         assert false : "How can all of the security checkers pass on checking 
this caller?";
         throw new PermissionDeniedException("There's no way to confirm " + 
account + " has access to " + dof);
     }
+
+    @Override
+    public void checkAccess(User user, ControlledEntity entity)
+        throws PermissionDeniedException {
+        for(SecurityChecker checker : _securityCheckers){
+            if(checker.checkAccess(user,entity)){
+                if(s_logger.isDebugEnabled()){
+                    s_logger.debug("Access granted to " + user + "to " + 
entity + "by " + checker.getName());
+                }
+                return;
 
 Review comment:
   @jayapalu is it assumed that checkAccess throws no exception? Can such a 
case happen where depending on the sequence of security checkers, we might 
allow an entity that may be failed by some other checker, i.e. should we return 
here?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to