Fixed updateUser command - didn't work correctly via 8096 port (user account info was taken from UserContext instead of User object).

This commit is contained in:
alena 2010-11-18 17:05:01 -08:00
parent 32e08a9cc7
commit 0b2b8e31d8
2 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,6 @@ import org.apache.log4j.Logger;
import com.cloud.api.ApiConstants;
import com.cloud.api.ApiResponseHelper;
import com.cloud.api.BaseCmd;
import com.cloud.api.BaseListCmd;
import com.cloud.api.Implementation;
import com.cloud.api.Parameter;

View File

@ -1081,6 +1081,7 @@ public class AccountManagerImpl implements AccountManager, AccountService {
String timeZone = cmd.getTimezone();
String userName = cmd.getUsername();
//Input validation
UserVO user = _userDao.getUser(id);
@ -1093,7 +1094,7 @@ public class AccountManagerImpl implements AccountManager, AccountService {
}
// If the account is an admin type, return an error. We do not allow this
Account account = UserContext.current().getAccount();
Account account = _accountDao.findById(user.getAccountId());
if (account != null && (account.getId() == Account.ACCOUNT_ID_SYSTEM)) {
throw new PermissionDeniedException("user id : " + id + " is system account, update is not allowed");