mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	bug 7535: ISO page - hide "Download ISO" option for non-admin user.
This commit is contained in:
		
							parent
							
								
									b4029d0a49
								
							
						
					
					
						commit
						291a9669e7
					
				| @ -317,9 +317,9 @@ function isoJsonToDetailsTab() { | ||||
|     $actionMenu.find("#action_list").empty(); | ||||
|     var noAvailableActions = true; | ||||
| 
 | ||||
|     // "Edit", "Copy", "Create VM" 
 | ||||
|     // "Edit ISO", "Copy ISO"
 | ||||
| 	if ((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) || jsonObj.isready == false) {		 | ||||
| 		//nothing happens
 | ||||
| 		//do nothing
 | ||||
|     } | ||||
|     else {         | ||||
|         buildActionLinkForTab("Edit ISO", isoActionMap, $actionMenu, $midmenuItem1, $thisTab);	 | ||||
| @ -340,17 +340,16 @@ function isoJsonToDetailsTab() { | ||||
|     } | ||||
| 	*/ | ||||
|      | ||||
| 	// "Delete" 
 | ||||
| 	// "Download ISO", "Delete ISO"
 | ||||
| 	if (((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account))) || (jsonObj.isready == false && jsonObj.isostatus != null && jsonObj.isostatus.indexOf("% Downloaded") != -1)) { | ||||
| 	    //do nothing
 | ||||
| 	} | ||||
| 	else {	     | ||||
| 	    buildActionLinkForTab("Download ISO", isoActionMap, $actionMenu, $midmenuItem1, $thisTab);	 | ||||
| 	    buildActionLinkForTab("Delete ISO", isoActionMap, $actionMenu, $midmenuItem1, $thisTab);	 | ||||
| 	    noAvailableActions = false; | ||||
| 	}    		    | ||||
| 	 | ||||
| 	buildActionLinkForTab("Download ISO", isoActionMap, $actionMenu, $midmenuItem1, $thisTab);	 | ||||
|     noAvailableActions = false;	 | ||||
| 	 | ||||
| 	// no available actions 
 | ||||
| 	if(noAvailableActions == true) { | ||||
| 	    $actionMenu.find("#action_list").append($("#no_available_actions").clone().show()); | ||||
|  | ||||
| @ -319,26 +319,28 @@ function templateJsonToDetailsTab() { | ||||
|     $actionMenu.find("#action_list").empty(); | ||||
|     var noAvailableActions = true; | ||||
|      | ||||
|     // action Edit, Copy, Create VM 			
 | ||||
|     // "Edit Template", "Copy Template", "Create VM"
 | ||||
| 	if ((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) || jsonObj.templatetype == "SYSTEM" || jsonObj.isready == false) { | ||||
| 		//$("#edit_button").hide();		
 | ||||
| 	    //do nothing	
 | ||||
|     } | ||||
|     else { | ||||
|         buildActionLinkForTab("Edit Template", templateActionMap, $actionMenu, $midmenuItem1, $thisTab);       | ||||
|         //$("#edit_button").show();
 | ||||
|          | ||||
|         buildActionLinkForTab("Copy Template", templateActionMap, $actionMenu, $midmenuItem1, $thisTab);			 | ||||
|          | ||||
|         // For Beta2, this simply doesn't work without a network.
 | ||||
| 		//buildActionLinkForTab("Create VM", templateActionMap, $actionMenu, $midmenuItem1, $thisTab);	 		       
 | ||||
|         buildActionLinkForTab("Download Template", templateActionMap, $actionMenu, $midmenuItem1, $thisTab); | ||||
|          | ||||
|         noAvailableActions = false;		 | ||||
|     } | ||||
| 	 | ||||
| 	// action Delete 			
 | ||||
| 	// "Download Template", "Delete Template"	
 | ||||
| 	if (((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)))  | ||||
| 		|| (jsonObj.isready == false && jsonObj.templatestatus != null && jsonObj.templatestatus.indexOf("% Downloaded") != -1) || jsonObj.templatetype == "SYSTEM") { | ||||
| 		//template.find("#template_delete_container").hide();
 | ||||
| 	    //do nothing	
 | ||||
|     } | ||||
|     else { | ||||
|         buildActionLinkForTab("Download Template", templateActionMap, $actionMenu, $midmenuItem1, $thisTab); | ||||
|         buildActionLinkForTab("Delete Template", templateActionMap, $actionMenu, $midmenuItem1, $thisTab); | ||||
|         noAvailableActions = false;	 | ||||
|     } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user