cloudstack UI - advanced search - dropdown field - check API permission before making API call.

This commit is contained in:
Jessica Wang 2012-10-04 17:16:06 -07:00
parent 8ea0a230e6
commit 7b1b9f8e95
5 changed files with 185 additions and 125 deletions

View File

@ -56,9 +56,11 @@
});
}
},
domainid: {
label: 'Domain',
select: function(args) {
if(isAdmin() || isDomainAdmin()) {
$.ajax({
url: createURL('listDomains'),
data: {
@ -78,6 +80,12 @@
});
}
});
}
else {
args.response.success({
data: null
});
}
},
isHidden: function(args) {
if(isAdmin() || isDomainAdmin())
@ -86,6 +94,7 @@
return true;
}
},
account: {
label: 'Account',
isHidden: function(args) {

View File

@ -86,6 +86,7 @@
domainid: {
label: 'Domain',
select: function(args) {
if(isAdmin() || isDomainAdmin()) {
$.ajax({
url: createURL('listDomains'),
data: {
@ -105,6 +106,12 @@
});
}
});
}
else {
args.response.success({
data: null
});
}
},
isHidden: function(args) {
if(isAdmin() || isDomainAdmin())

View File

@ -464,9 +464,11 @@
});
}
},
domainid: {
label: 'Domain',
select: function(args) {
if(isAdmin() || isDomainAdmin()) {
$.ajax({
url: createURL('listDomains'),
data: {
@ -486,6 +488,12 @@
});
}
});
}
else {
args.response.success({
data: null
});
}
},
isHidden: function(args) {
if(isAdmin() || isDomainAdmin())
@ -494,6 +502,7 @@
return true;
}
},
account: {
label: 'Account',
isHidden: function(args) {
@ -3681,9 +3690,11 @@
});
}
},
domainid: {
label: 'Domain',
select: function(args) {
if(isAdmin() || isDomainAdmin()) {
$.ajax({
url: createURL('listDomains'),
data: {
@ -3703,6 +3714,12 @@
});
}
});
}
else {
args.response.success({
data: null
});
}
},
isHidden: function(args) {
if(isAdmin() || isDomainAdmin())
@ -3711,6 +3728,7 @@
return true;
}
},
account: {
label: 'Account',
isHidden: function(args) {

View File

@ -647,9 +647,11 @@
});
}
},
domainid: {
label: 'Domain',
select: function(args) {
if(isAdmin() || isDomainAdmin()) {
$.ajax({
url: createURL('listDomains'),
data: {
@ -669,6 +671,12 @@
});
}
});
}
else {
args.response.success({
data: null
});
}
},
isHidden: function(args) {
if(isAdmin() || isDomainAdmin())
@ -677,6 +685,7 @@
return true;
}
},
account: {
label: 'Account',
isHidden: function(args) {

View File

@ -297,6 +297,7 @@
domainid: {
label: 'Domain',
select: function(args) {
if(isAdmin() || isDomainAdmin()) {
$.ajax({
url: createURL('listDomains'),
data: {
@ -316,6 +317,12 @@
});
}
});
}
else {
args.response.success({
data: null
});
}
},
isHidden: function(args) {
if(isAdmin() || isDomainAdmin())
@ -324,6 +331,7 @@
return true;
}
},
account: {
label: 'Account',
isHidden: function(args) {
@ -1114,9 +1122,11 @@
advSearchFields: {
name: { label: 'Name' },
domainid: {
label: 'Domain',
select: function(args) {
if(isAdmin() || isDomainAdmin()) {
$.ajax({
url: createURL('listDomains'),
data: {
@ -1136,6 +1146,12 @@
});
}
});
}
else {
args.response.success({
data: null
});
}
},
isHidden: function(args) {
if(isAdmin() || isDomainAdmin())
@ -1144,6 +1160,7 @@
return true;
}
},
account: {
label: 'Account',
isHidden: function(args) {