bug 9642: listVms by regular user using domainId parameter will work only when domainId specified is the domainId the caller belongs to.

status 9642: resolved fixed
This commit is contained in:
alena 2011-06-20 10:32:19 -07:00
parent fa312617f1
commit c663217b00
1 changed files with 5 additions and 0 deletions

View File

@ -79,6 +79,7 @@ import com.cloud.configuration.ResourceCount.ResourceType;
import com.cloud.configuration.dao.ConfigurationDao;
import com.cloud.configuration.dao.ResourceLimitDao;
import com.cloud.dc.DataCenter;
import com.cloud.dc.DataCenter.NetworkType;
import com.cloud.dc.DataCenterVO;
import com.cloud.dc.HostPodVO;
import com.cloud.dc.dao.AccountVlanMapDao;
@ -2970,6 +2971,10 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
}
}
} else {
//regular user can't specify any other domain rather than his own
if (domainId != null && domainId.longValue() != caller.getDomainId()) {
throw new PermissionDeniedException("Caller is not authorised to see domain id=" + domainId + " entries");
}
accountId = caller.getId();
}