mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-3364:
change updateIsoPermissions API to accept isextractable paramter from normal user
This commit is contained in:
parent
2cbaf04b97
commit
03c78247cc
@ -1264,18 +1264,14 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
|
|||||||
updatedTemplate.setFeatured(isFeatured.booleanValue());
|
updatedTemplate.setFeatured(isFeatured.booleanValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isExtractable != null && caller.getType() == Account.ACCOUNT_TYPE_ADMIN) {// Only
|
if(isExtractable != null){
|
||||||
// ROOT
|
// Only Root admins allowed to change it for templates
|
||||||
// admins
|
if(!template.getFormat().equals(ImageFormat.ISO) && caller.getType() != Account.ACCOUNT_TYPE_ADMIN){
|
||||||
// allowed
|
|
||||||
// to
|
|
||||||
// change
|
|
||||||
// this
|
|
||||||
// powerful
|
|
||||||
// attribute
|
|
||||||
updatedTemplate.setExtractable(isExtractable.booleanValue());
|
|
||||||
} else if (isExtractable != null && caller.getType() != Account.ACCOUNT_TYPE_ADMIN) {
|
|
||||||
throw new InvalidParameterValueException("Only ROOT admins are allowed to modify this attribute.");
|
throw new InvalidParameterValueException("Only ROOT admins are allowed to modify this attribute.");
|
||||||
|
}else{
|
||||||
|
// For Isos normal user can change it, as their are no derivatives.
|
||||||
|
updatedTemplate.setExtractable(isExtractable.booleanValue());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_tmpltDao.update(template.getId(), updatedTemplate);
|
_tmpltDao.update(template.getId(), updatedTemplate);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user