rafaelweingartner commented on a change in pull request #2574:
[CLOUDSTACK-5235] ask users current password when they are executing a password
update
URL: https://github.com/apache/cloudstack/pull/2574#discussion_r185206649
##########
File path: server/src/main/java/com/cloud/user/AccountManagerImpl.java
##########
@@ -1633,16 +1720,16 @@ public AccountVO updateAccount(UpdateAccountCmd cmd) {
}
// Check if user performing the action is allowed to modify this
account
- checkAccess(CallContext.current().getCallingAccount(),
_domainMgr.getDomain(account.getDomainId()));
+ checkAccess(getCurrentCallingAccount(),
_domainMgr.getDomain(account.getDomainId()));
// check if the given account name is unique in this domain for
updating
Account duplicateAcccount =
_accountDao.findActiveAccount(newAccountName, domainId);
if (duplicateAcccount != null && duplicateAcccount.getId() !=
account.getId()) {// allow
-
// same
-
// account
-
// to
-
// update
-
// itself
+ // same
Review comment:
Well, these were already there. Probably the lines shifted because of my
changes, but I can fix it without problems.
Side note: I do not appreciate code comments. They are a sign that the
method is too big and complicated. This means that code should be extracted to
smaller methods and then documented.
----------------------------------------------------------------
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