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

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

harikrishna-patnala commented on code in PR #7870:
URL: https://github.com/apache/cloudstack/pull/7870#discussion_r1295592071


##########
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:
   @winterhazel I agree with you that this is an issue. But instead of completely taking out the domain check, we need to check if the user domain is part of the caller domain ? Otherwise, any root admin under any domain could disable 2FA of any user. what do you say?



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