winterhazel commented on code in PR #7870:
URL: https://github.com/apache/cloudstack/pull/7870#discussion_r1296288735


##########
server/src/main/java/com/cloud/user/AccountManagerImpl.java:
##########
@@ -3349,16 +3349,13 @@ protected UserTwoFactorAuthenticationSetupResponse 
disableTwoFactorAuthenticatio
         return response;
     }
 
-    private UserVO validateUser(Long userId, Long domainId) {
+    private UserVO validateUser(Long userId) {
         UserVO user = null;
         if (userId != null) {
             user = _userDao.findById(userId);
             if (user == null) {
                 throw new InvalidParameterValueException("Invalid user ID 
provided");
             }
-            if (_accountDao.findById(user.getAccountId()).getDomainId() != 
domainId) {

Review Comment:
   > @harikrishna-patnala line 3336 will do the trick I think.
   > 
   > ```
   > checkAccess(caller, null, true, owner);
   > ```
   
   @harikrishna-patnala @weizhouapache Exactly, after this method, the code 
checks if the admin has access to the user. This was tested in scenarios 9 and 
10: when the admin does not have access to the domain of the user, a 
PermisisonDeniedException is thrown.



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