mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-11-04 00:02:37 +01:00 
			
		
		
		
	CLOUDSTACK-4987: UI > Instances > detailView > NICs tab > Add network to VM > Network dropdown => (1) For root-admin, populate networks of all accounts. (2) For regular-user/domain-admin, populate only networks belonging to this VM owner.
(cherry picked from commit 794ee6929d078fd919842f2c1f55156f133d7934)
This commit is contained in:
		
							parent
							
								
									a516e5d224
								
							
						
					
					
						commit
						9714ecbde8
					
				@ -1945,13 +1945,22 @@
 | 
			
		||||
                                        networkid: {
 | 
			
		||||
                                            label: 'label.network',
 | 
			
		||||
                                            select: function(args) {
 | 
			
		||||
                                                $.ajax({
 | 
			
		||||
                                                    url: createURL('listNetworks'),
 | 
			
		||||
                                                    data: {
 | 
			
		||||
                                                        zoneid: args.context.instances[0].zoneid,
 | 
			
		||||
                                            	var data1 = {
 | 
			
		||||
                                            		zoneid: args.context.instances[0].zoneid	
 | 
			
		||||
                                            	};
 | 
			
		||||
                                            	if (isAdmin()) {
 | 
			
		||||
                                            		$.extend(data1, {
 | 
			
		||||
                                            			listAll: true
 | 
			
		||||
                                            		});
 | 
			
		||||
                                            	} else {
 | 
			
		||||
                                            		$.extend(data1, {
 | 
			
		||||
                                            			account: args.context.instances[0].account,
 | 
			
		||||
                                                        domainid: args.context.instances[0].domainid
 | 
			
		||||
                                                    },
 | 
			
		||||
                                            		});
 | 
			
		||||
                                            	}     
 | 
			
		||||
                                                $.ajax({
 | 
			
		||||
                                                    url: createURL('listNetworks'),
 | 
			
		||||
                                                    data: data1,
 | 
			
		||||
                                                    success: function(json) {
 | 
			
		||||
                                                        args.response.success({
 | 
			
		||||
                                                            data: $.map(json.listnetworksresponse.network, function(network) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user