luci-mod-status: hide DHCP and assoclist on insufficient ACLs
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
a0db2abea3
commit
2dbd9ff245
2 changed files with 6 additions and 4 deletions
|
@ -14,7 +14,7 @@ return baseclass.extend({
|
||||||
|
|
||||||
load: function() {
|
load: function() {
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
L.resolveDefault(callLuciDHCPLeases(), {}),
|
callLuciDHCPLeases(),
|
||||||
network.getHostHints()
|
network.getHostHints()
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
|
|
|
@ -100,6 +100,7 @@ return baseclass.extend({
|
||||||
network.getWifiDevices(),
|
network.getWifiDevices(),
|
||||||
network.getWifiNetworks(),
|
network.getWifiNetworks(),
|
||||||
network.getHostHints(),
|
network.getHostHints(),
|
||||||
|
callSessionAccess('access-group', 'luci-mod-status-index-wifi', 'read'),
|
||||||
callSessionAccess('access-group', 'luci-mod-status-index-wifi', 'write')
|
callSessionAccess('access-group', 'luci-mod-status-index-wifi', 'write')
|
||||||
]).then(function(radios_networks_hints) {
|
]).then(function(radios_networks_hints) {
|
||||||
var tasks = [];
|
var tasks = [];
|
||||||
|
@ -120,7 +121,8 @@ return baseclass.extend({
|
||||||
radios = data[0],
|
radios = data[0],
|
||||||
networks = data[1],
|
networks = data[1],
|
||||||
hosthints = data[2],
|
hosthints = data[2],
|
||||||
hasWritePermission = data[3];
|
hasReadPermission = data[3],
|
||||||
|
hasWritePermission = data[4];
|
||||||
|
|
||||||
var table = E('div', { 'class': 'network-status-table' });
|
var table = E('div', { 'class': 'network-status-table' });
|
||||||
|
|
||||||
|
@ -240,8 +242,8 @@ return baseclass.extend({
|
||||||
|
|
||||||
return E([
|
return E([
|
||||||
table,
|
table,
|
||||||
E('h3', _('Associated Stations')),
|
hasReadPermission ? E('h3', _('Associated Stations')) : E([]),
|
||||||
assoclist
|
hasReadPermission ? assoclist : E([])
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue