summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-04-16 15:21:03 +0200
committerJo-Philipp Wich <jo@mein.io>2020-04-16 15:21:03 +0200
commitc63c902163ceb811dd13f134e2afe8b55b18c4a6 (patch)
treefb17f7d0ea3310ce442ee27f9de6442f9fa9e883 /modules
parent90a51ab3b9afca0144a93eb967fcd72a230732f0 (diff)
luci-mod-network: interfaces.js: disable action buttons on insufficient ACLs
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules')
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js
index bd4ce57901..bee5753055 100644
--- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js
+++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js
@@ -10,6 +10,8 @@
'require firewall';
'require tools.widgets as widgets';
+var isReadonlyView = !L.hasViewPermission() || null;
+
function count_changes(section_id) {
var changes = ui.changes.changes, n = 0;
@@ -281,8 +283,8 @@ return view.extend({
]);
}
- btn1.disabled = btn1.classList.contains('spinning') || btn2.classList.contains('spinning') || dynamic;
- btn2.disabled = btn1.classList.contains('spinning') || btn2.classList.contains('spinning') || dynamic || disabled;
+ btn1.disabled = isReadonlyView || btn1.classList.contains('spinning') || btn2.classList.contains('spinning') || dynamic;
+ btn2.disabled = isReadonlyView || btn1.classList.contains('spinning') || btn2.classList.contains('spinning') || dynamic || disabled;
}
return Promise.all([ resolveZone, network.flushCache() ]);