winterhazel opened a new pull request, #7870: URL: https://github.com/apache/cloudstack/pull/7870
### Description Admins should be able to disable the 2FA of users that lost their second factor; however, the `setupUserTwoFactorAuthentication` API only allows them to disable the 2FA of users in the same domain. This means that, if the root admin wants to disable the 2FA of a user in ROOT/test, he must create a domain admin account in ROOT/test and log into that account to do this. This PR addresses this issue by allowing admins to disable the 2FA of users in their subdomains. ### Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [ ] Bug fix (non-breaking change which fixes an issue) - [X] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) ### Feature/Enhancement Scale or Bug Severity #### Feature/Enhancement Scale - [ ] Major - [X] Minor #### Bug Severity - [ ] BLOCKER - [ ] Critical - [ ] Major - [ ] Minor - [ ] Trivial ### Screenshots (if appropriate): ### How Has This Been Tested? I did the following tests in a local lab: | Number | Test | Previous result | New result | New result was expected (Y/N)? | | - | - | - | - | - | | 1 | Disable your own 2FA as the root admin | Success | Success | Y | | 2 | Disable the 2FA of a user in ROOT as the root admin | Success | Success | Y | | 3 | Disable the 2FA of a user in ROOT/test as the root admin | Exception | Success | Y | | 4 | Disable your own 2FA as the domain admin of ROOT/test | Success | Success | Y | | 5 | Disable the 2FA of a user in ROOT/test as the domain admin of ROOT/test | Success | Success | Y | | 6 | Disable the 2FA of a user in ROOT/test/test2 as the domain admin of ROOT/test | Exception | Success | Y | | 7 | Disable the 2FA of a domain admin of ROOT/test as another domain admin of ROOT/test | Success | Success | Y | | 8 | Disable the 2FA of a domain admin of ROOT/test/test2 as the domain admin of ROOT/test | Exception | Success | Y | | 9 | Disable the 2FA of a domain admin of ROOT as the domain admin of ROOT/test | Exception | Exception | Y | | 10 | Disable the 2FA of a domain admin of ROOT/test3 as the domain admin of ROOT/test | Exception | Exception | Y | | 11 | Disable your own 2FA as a non-administrator user | Success | Success | Y | -- 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]
