mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
cloudstack 3.0 UI - autoscale - configure AutoScale - fix a bug when root-admin tried to update an AutoScale created by regular-user or domain-admin, users dropdown was not correctly populated (should be populated with users under owner account instead of users under current login account).
This commit is contained in:
parent
67ea9669ab
commit
e1275b4916
@ -407,25 +407,50 @@
|
||||
label: 'User',
|
||||
select: function(args) {
|
||||
var items = [];
|
||||
if(isAdmin() || isDomainAdmin()) {
|
||||
$.ajax({
|
||||
url: createURL('listUsers'),
|
||||
data: {
|
||||
domainid: g_domainid,
|
||||
account: g_account
|
||||
},
|
||||
success: function(json) {
|
||||
var users = json.listusersresponse.user;
|
||||
$(users).each(function(){
|
||||
items.push({id: this.id, description: this.username});
|
||||
});
|
||||
args.response.success({ data: items });
|
||||
}
|
||||
});
|
||||
}
|
||||
else { //regular user doesn't have access to listUers API call.
|
||||
items.push({id: "", description: ""});
|
||||
}
|
||||
if(args.context.originalAutoscaleData == null) { //new LB rule
|
||||
if(isAdmin() || isDomainAdmin()) {
|
||||
$.ajax({
|
||||
url: createURL('listUsers'),
|
||||
data: {
|
||||
domainid: g_domainid,
|
||||
account: g_account
|
||||
},
|
||||
success: function(json) {
|
||||
var users = json.listusersresponse.user;
|
||||
$(users).each(function(){
|
||||
items.push({id: this.id, description: this.username});
|
||||
});
|
||||
args.response.success({ data: items });
|
||||
}
|
||||
});
|
||||
}
|
||||
else { //regular user doesn't have access to listUers API call.
|
||||
items.push({id: "", description: ""});
|
||||
args.response.success({ data: items });
|
||||
}
|
||||
}
|
||||
else { //existing LB rule
|
||||
if(isAdmin() || isDomainAdmin()) {
|
||||
$.ajax({
|
||||
url: createURL('listUsers'),
|
||||
data: {
|
||||
domainid: args.context.originalAutoscaleData.context.autoscaleVmProfile.domainid,
|
||||
account: args.context.originalAutoscaleData.context.autoscaleVmProfile.account
|
||||
},
|
||||
success: function(json) {
|
||||
var users = json.listusersresponse.user;
|
||||
$(users).each(function(){
|
||||
items.push({id: this.id, description: this.username});
|
||||
});
|
||||
args.response.success({ data: items });
|
||||
}
|
||||
});
|
||||
}
|
||||
else { //regular user doesn't have access to listUers API call.
|
||||
items.push({id: "", description: ""});
|
||||
args.response.success({ data: items });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user