summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-04-16 15:32:06 +0200
committerJo-Philipp Wich <jo@mein.io>2020-04-16 15:32:32 +0200
commit17770e49ebb2ef7c9c348aa69146e33988f69720 (patch)
tree3d26b935b440a11150ae7be9e1c43fecc88a67be /modules
parentdc57e4bc6c83d6c869c318256057e3636bfc5d66 (diff)
luci-mod-status: assoclist: hide wifi disconnect on insufficient ACLs
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules')
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js16
1 files changed, 13 insertions, 3 deletions
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 115fe99095..1e3aeb2426 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
@@ -2,6 +2,14 @@
'require baseclass';
'require dom';
'require network';
+'require rpc';
+
+var callSessionAccess = rpc.declare({
+ object: 'session',
+ method: 'access',
+ params: [ 'scope', 'object', 'function' ],
+ expect: { 'access': false }
+});
function renderbox(radio, networks) {
var chan = null,
@@ -91,7 +99,8 @@ return baseclass.extend({
return Promise.all([
network.getWifiDevices(),
network.getWifiNetworks(),
- network.getHostHints()
+ network.getHostHints(),
+ callSessionAccess('access-group', 'luci-mod-status-index-wifi', 'write')
]).then(function(radios_networks_hints) {
var tasks = [];
@@ -110,7 +119,8 @@ return baseclass.extend({
var seen = {},
radios = data[0],
networks = data[1],
- hosthints = data[2];
+ hosthints = data[2],
+ hasWritePermission = data[3];
var table = E('div', { 'class': 'network-status-table' });
@@ -209,7 +219,7 @@ return baseclass.extend({
])
];
- if (networks[i].isClientDisconnectSupported()) {
+ if (networks[i].isClientDisconnectSupported() && hasWritePermission) {
if (assoclist.firstElementChild.childNodes.length < 6)
assoclist.firstElementChild.appendChild(E('div', { 'class': 'th cbi-section-actions' }));