mirror of https://github.com/apache/cloudstack.git
bug 7046 : Global admins should be allowed to extract all the times.
status 7046: resolved fixed
This commit is contained in:
parent
841044e360
commit
d0530265d7
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue