bug 7046 : Global admins should be allowed to extract all the times.

status 7046: resolved fixed
This commit is contained in:
nit 2010-11-24 19:33:15 +05:30
parent 841044e360
commit d0530265d7
2 changed files with 2 additions and 2 deletions

View File

@ -5199,7 +5199,7 @@ public class ManagementServerImpl implements ManagementServer {
VMTemplateVO template = ApiDBUtils.findTemplateById(volume.getTemplateId());
boolean isExtractable = template != null && template.isExtractable() && !(template.getTemplateType()== Storage.TemplateType.SYSTEM || template.getTemplateType()== Storage.TemplateType.BUILTIN);
if( !isExtractable ){
if( !isExtractable && account!=null && account.getType() != Account.ACCOUNT_TYPE_ADMIN){ // Global admins are allowed to extract
throw new PermissionDeniedException("The volume:" +volumeId+ " is not allowed to be extracted");
}

View File

@ -504,7 +504,7 @@ public class TemplateManagerImpl implements TemplateManager, Manager, TemplateSe
throw new InvalidParameterValueException("Unsupported format, could not extract the template");
}
}
if(!template.isExtractable()){
if(!template.isExtractable() && account!=null && account.getType() != Account.ACCOUNT_TYPE_ADMIN){ // Global admins are always allowed to extract
throw new PermissionDeniedException("The "+ desc + " is not allowed to be extracted" );
}
if (_dcDao.findById(zoneId) == null) {