GabrielBrascher commented on a change in pull request #3058: CLOUDSTACK-3049: 
update dynamic role for an account
URL: https://github.com/apache/cloudstack/pull/3058#discussion_r250608689
 
 

 ##########
 File path: server/src/main/java/com/cloud/user/AccountManagerImpl.java
 ##########
 @@ -1712,25 +1720,48 @@ public AccountVO updateAccount(UpdateAccountCmd cmd) {
         }
 
         // Check if user performing the action is allowed to modify this 
account
-        checkAccess(getCurrentCallingAccount(), 
_domainMgr.getDomain(account.getDomainId()));
+        Account caller = getCurrentCallingAccount();
+        checkAccess(caller, _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()) {
-            throw new InvalidParameterValueException(
-                    "There already exists an account with the name:" + 
newAccountName + " in the domain:" + domainId + " with existing account id:" + 
duplicateAcccount.getId());
+        if(newAccountName != null) {
+
+            if (newAccountName.isEmpty()) {
 
 Review comment:
   @bwsw can you please address @dhlaluku comment? Thanks!

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

Reply via email to