summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-status
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-04-18 19:58:35 +0200
committerJo-Philipp Wich <jo@mein.io>2020-04-18 23:25:22 +0200
commit2dbd9ff2459dc2d1819ef890aafc5ca9f0d4e769 (patch)
treeab23e89487ef3703e9bf67844f587fc35ef4d5c5 /modules/luci-mod-status
parenta0db2abea3ceae24f376af31ffb7ca5e76d19da6 (diff)
luci-mod-status: hide DHCP and assoclist on insufficient ACLs
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-status')
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/40_dhcp.js2
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js8
2 files changed, 6 insertions, 4 deletions
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/40_dhcp.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/40_dhcp.js
index f839a180c..603c0d93a 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/40_dhcp.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/40_dhcp.js
@@ -14,7 +14,7 @@ return baseclass.extend({
load: function() {
return Promise.all([
- L.resolveDefault(callLuciDHCPLeases(), {}),
+ callLuciDHCPLeases(),
network.getHostHints()
]);
},
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js
index 1e3aeb242..deb6f8609 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js
@@ -100,6 +100,7 @@ return baseclass.extend({
network.getWifiDevices(),
network.getWifiNetworks(),
network.getHostHints(),
+ callSessionAccess('access-group', 'luci-mod-status-index-wifi', 'read'),
callSessionAccess('access-group', 'luci-mod-status-index-wifi', 'write')
]).then(function(radios_networks_hints) {
var tasks = [];
@@ -120,7 +121,8 @@ return baseclass.extend({
radios = data[0],
networks = data[1],
hosthints = data[2],
- hasWritePermission = data[3];
+ hasReadPermission = data[3],
+ hasWritePermission = data[4];
var table = E('div', { 'class': 'network-status-table' });
@@ -240,8 +242,8 @@ return baseclass.extend({
return E([
table,
- E('h3', _('Associated Stations')),
- assoclist
+ hasReadPermission ? E('h3', _('Associated Stations')) : E([]),
+ hasReadPermission ? assoclist : E([])
]);
}
});