mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
cloudstack UI - advanced search - dropdown field - check API permission before making API call.
This commit is contained in:
parent
8ea0a230e6
commit
7b1b9f8e95
@ -56,9 +56,11 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
domainid: {
|
domainid: {
|
||||||
label: 'Domain',
|
label: 'Domain',
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
|
if(isAdmin() || isDomainAdmin()) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listDomains'),
|
url: createURL('listDomains'),
|
||||||
data: {
|
data: {
|
||||||
@ -78,6 +80,12 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
args.response.success({
|
||||||
|
data: null
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
isHidden: function(args) {
|
isHidden: function(args) {
|
||||||
if(isAdmin() || isDomainAdmin())
|
if(isAdmin() || isDomainAdmin())
|
||||||
@ -86,6 +94,7 @@
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
account: {
|
account: {
|
||||||
label: 'Account',
|
label: 'Account',
|
||||||
isHidden: function(args) {
|
isHidden: function(args) {
|
||||||
|
|||||||
@ -86,6 +86,7 @@
|
|||||||
domainid: {
|
domainid: {
|
||||||
label: 'Domain',
|
label: 'Domain',
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
|
if(isAdmin() || isDomainAdmin()) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listDomains'),
|
url: createURL('listDomains'),
|
||||||
data: {
|
data: {
|
||||||
@ -105,6 +106,12 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
args.response.success({
|
||||||
|
data: null
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
isHidden: function(args) {
|
isHidden: function(args) {
|
||||||
if(isAdmin() || isDomainAdmin())
|
if(isAdmin() || isDomainAdmin())
|
||||||
|
|||||||
@ -464,9 +464,11 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
domainid: {
|
domainid: {
|
||||||
label: 'Domain',
|
label: 'Domain',
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
|
if(isAdmin() || isDomainAdmin()) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listDomains'),
|
url: createURL('listDomains'),
|
||||||
data: {
|
data: {
|
||||||
@ -486,6 +488,12 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
args.response.success({
|
||||||
|
data: null
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
isHidden: function(args) {
|
isHidden: function(args) {
|
||||||
if(isAdmin() || isDomainAdmin())
|
if(isAdmin() || isDomainAdmin())
|
||||||
@ -494,6 +502,7 @@
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
account: {
|
account: {
|
||||||
label: 'Account',
|
label: 'Account',
|
||||||
isHidden: function(args) {
|
isHidden: function(args) {
|
||||||
@ -3681,9 +3690,11 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
domainid: {
|
domainid: {
|
||||||
label: 'Domain',
|
label: 'Domain',
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
|
if(isAdmin() || isDomainAdmin()) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listDomains'),
|
url: createURL('listDomains'),
|
||||||
data: {
|
data: {
|
||||||
@ -3703,6 +3714,12 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
args.response.success({
|
||||||
|
data: null
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
isHidden: function(args) {
|
isHidden: function(args) {
|
||||||
if(isAdmin() || isDomainAdmin())
|
if(isAdmin() || isDomainAdmin())
|
||||||
@ -3711,6 +3728,7 @@
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
account: {
|
account: {
|
||||||
label: 'Account',
|
label: 'Account',
|
||||||
isHidden: function(args) {
|
isHidden: function(args) {
|
||||||
|
|||||||
@ -647,9 +647,11 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
domainid: {
|
domainid: {
|
||||||
label: 'Domain',
|
label: 'Domain',
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
|
if(isAdmin() || isDomainAdmin()) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listDomains'),
|
url: createURL('listDomains'),
|
||||||
data: {
|
data: {
|
||||||
@ -669,6 +671,12 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
args.response.success({
|
||||||
|
data: null
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
isHidden: function(args) {
|
isHidden: function(args) {
|
||||||
if(isAdmin() || isDomainAdmin())
|
if(isAdmin() || isDomainAdmin())
|
||||||
@ -677,6 +685,7 @@
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
account: {
|
account: {
|
||||||
label: 'Account',
|
label: 'Account',
|
||||||
isHidden: function(args) {
|
isHidden: function(args) {
|
||||||
|
|||||||
@ -297,6 +297,7 @@
|
|||||||
domainid: {
|
domainid: {
|
||||||
label: 'Domain',
|
label: 'Domain',
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
|
if(isAdmin() || isDomainAdmin()) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listDomains'),
|
url: createURL('listDomains'),
|
||||||
data: {
|
data: {
|
||||||
@ -316,6 +317,12 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
args.response.success({
|
||||||
|
data: null
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
isHidden: function(args) {
|
isHidden: function(args) {
|
||||||
if(isAdmin() || isDomainAdmin())
|
if(isAdmin() || isDomainAdmin())
|
||||||
@ -324,6 +331,7 @@
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
account: {
|
account: {
|
||||||
label: 'Account',
|
label: 'Account',
|
||||||
isHidden: function(args) {
|
isHidden: function(args) {
|
||||||
@ -1114,9 +1122,11 @@
|
|||||||
|
|
||||||
advSearchFields: {
|
advSearchFields: {
|
||||||
name: { label: 'Name' },
|
name: { label: 'Name' },
|
||||||
|
|
||||||
domainid: {
|
domainid: {
|
||||||
label: 'Domain',
|
label: 'Domain',
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
|
if(isAdmin() || isDomainAdmin()) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listDomains'),
|
url: createURL('listDomains'),
|
||||||
data: {
|
data: {
|
||||||
@ -1136,6 +1146,12 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
args.response.success({
|
||||||
|
data: null
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
isHidden: function(args) {
|
isHidden: function(args) {
|
||||||
if(isAdmin() || isDomainAdmin())
|
if(isAdmin() || isDomainAdmin())
|
||||||
@ -1144,6 +1160,7 @@
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
account: {
|
account: {
|
||||||
label: 'Account',
|
label: 'Account',
|
||||||
isHidden: function(args) {
|
isHidden: function(args) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user