mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-6468:IAM - Templates - Admin user is not allowed to edit
template and set isExtractable() paramater. (cherry picked from commit b6617843d258d9437a17d39e698edba430768f9a) Signed-off-by: Nitin Mehta <nitin.mehta@citrix.com>
This commit is contained in:
parent
f4d2034755
commit
cc8fc746df
@ -1263,8 +1263,8 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
|
|||||||
|
|
||||||
if (isExtractable != null) {
|
if (isExtractable != null) {
|
||||||
// Only Root admins allowed to change it for templates
|
// Only Root admins allowed to change it for templates
|
||||||
if (!template.getFormat().equals(ImageFormat.ISO) && _accountMgr.isRootAdmin(caller.getId())) {
|
if (!template.getFormat().equals(ImageFormat.ISO) && !_accountMgr.isRootAdmin(caller.getId())) {
|
||||||
throw new InvalidParameterValueException("Only ROOT admins are allowed to modify this attribute.");
|
throw new InvalidParameterValueException("Only ROOT admins are allowed to modify isExtractable attribute.");
|
||||||
} else {
|
} else {
|
||||||
// For Isos normal user can change it, as their are no derivatives.
|
// For Isos normal user can change it, as their are no derivatives.
|
||||||
updatedTemplate.setExtractable(isExtractable.booleanValue());
|
updatedTemplate.setExtractable(isExtractable.booleanValue());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user