@@ -1297,7 +1297,7 @@ public UserAccount createUserAccount(final String userName, final String passwor
1297
1297
// Check permissions
1298
1298
checkAccess (getCurrentCallingAccount (), domain );
1299
1299
1300
- if (!userAllowMultipleAccounts .valueInDomain ( domainId ) && !_userAccountDao .validateUsernameInDomain (userName , domainId )) {
1300
+ if (!userAllowMultipleAccounts .valueInScope ( ConfigKey . Scope . Domain , domainId ) && !_userAccountDao .validateUsernameInDomain (userName , domainId )) {
1301
1301
throw new InvalidParameterValueException (String .format ("The user %s already exists in domain %s" , userName , domain ));
1302
1302
}
1303
1303
@@ -1485,7 +1485,7 @@ public UserVO createUser(String userName, String password, String firstName, Str
1485
1485
throw new PermissionDeniedException (String .format ("Account: %s is a system account, can't add a user to it" , account ));
1486
1486
}
1487
1487
1488
- if (!userAllowMultipleAccounts .valueInDomain ( domainId ) && !_userAccountDao .validateUsernameInDomain (userName , domainId )) {
1488
+ if (!userAllowMultipleAccounts .valueInScope ( ConfigKey . Scope . Domain , domainId ) && !_userAccountDao .validateUsernameInDomain (userName , domainId )) {
1489
1489
throw new CloudRuntimeException ("The user " + userName + " already exists in domain " + domainId );
1490
1490
}
1491
1491
List <UserVO > duplicatedUsers = _userDao .findUsersByName (userName );
@@ -1636,7 +1636,7 @@ protected void validateAndUpdateUsernameIfNeeded(UpdateUserCmd updateUserCmd, Us
1636
1636
}
1637
1637
1638
1638
// duplicate usernames cannot exist in same domain unless explicitly configured
1639
- if (!userAllowMultipleAccounts .valueInDomain ( newAccount .getDomainId ())) {
1639
+ if (!userAllowMultipleAccounts .valueInScope ( ConfigKey . Scope . Domain , newAccount .getDomainId ())) {
1640
1640
assertUserNotAlreadyInDomain (existingUser , newAccount );
1641
1641
}
1642
1642
0 commit comments