You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "winterhazel (via GitHub)" <gi...@apache.org> on 2023/08/16 18:32:03 UTC

[GitHub] [cloudstack] winterhazel commented on a diff in pull request #7870: Allow admins to disable the 2FA of users in subdomains

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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org