mirror of https://github.com/apache/cloudstack.git
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:
parent
32e08a9cc7
commit
0b2b8e31d8
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in New Issue