From 64ab85069d2d6fbad5cab4868c3be06fbb1fb790 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 16 Aug 2013 19:50:16 -0700 Subject: [PATCH] CLOUDSTACK-3950: UI > template/ISO page > hide CopyTemplate/CopyISO action when it's region-wide (i.e. zoneid is null) --- ui/scripts/templates.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js index 4b544ab4505..d596bc2971b 100644 --- a/ui/scripts/templates.js +++ b/ui/scripts/templates.js @@ -1660,9 +1660,12 @@ } else { allowedActions.push("edit"); - if (havingSwift == false && havingS3 == false) + //Swift and S3 are region-wide secondary storage + //if (havingSwift == false && havingS3 == false) + if (havingSwift == false && jsonObj.zoneid != null) { //"jsonObj.zoneid == null" means it is registered on region-wide S3 => global to all zones allowedActions.push("copyTemplate"); - + } + //allowedActions.push("createVm"); // For Beta2, this simply doesn't work without a network. } @@ -1697,8 +1700,10 @@ } else { allowedActions.push("edit"); - if (havingSwift == false) + //Swift and S3 are region-wide secondary storage + if (havingSwift == false && jsonObj.zoneid != null) { //"jsonObj.zoneid == null" means it is registered on region-wide S3 => global to all zones allowedActions.push("copyISO"); + } } // "Create VM"