bug 9991: do account permission check in getCloudIdentifier api

status 9991: resolved fixed
This commit is contained in:
alena 2011-06-20 10:15:45 -07:00
parent c663217b00
commit 630e8d9db4
1 changed files with 4 additions and 0 deletions

View File

@ -4094,12 +4094,16 @@ public class ManagementServerImpl implements ManagementServer {
@Override
public ArrayList<String> getCloudIdentifierResponse(GetCloudIdentifierCmd cmd) {
Long userId = cmd.getUserId();
Account caller = UserContext.current().getCaller();
// verify that user exists
User user = findUserById(userId);
if ((user == null) || (user.getRemoved() != null)) {
throw new InvalidParameterValueException("Unable to find active user by id " + userId);
}
// check permissions
_accountMgr.checkAccess(caller, _accountMgr.getAccount(user.getAccountId()));
String cloudIdentifier = _configDao.getValue("cloud.identifier");
if (cloudIdentifier == null) {