From 6037c8a847962a52ceb48f3c8059c60300949bc8 Mon Sep 17 00:00:00 2001 From: Jan Hoffmann Date: Fri, 24 Apr 2020 18:43:03 +0200 Subject: luci-app-vnstat2: fix ACL rules, disable button on insufficient ACLs Signed-off-by: Jan Hoffmann --- .../htdocs/luci-static/resources/view/vnstat2/config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'applications/luci-app-vnstat2/htdocs/luci-static') diff --git a/applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2/config.js b/applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2/config.js index 14e968a071..46781442a3 100644 --- a/applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2/config.js +++ b/applications/luci-app-vnstat2/htdocs/luci-static/resources/view/vnstat2/config.js @@ -8,6 +8,8 @@ 'require form'; 'require tools.widgets as widgets'; +var isReadonlyView = !L.hasViewPermission() || null; + return view.extend({ handleDeleteModal: function(m, iface, ev) { L.showModal(_('Delete interface %h').format(iface), [ @@ -88,7 +90,8 @@ return view.extend({ this.interfaces[i], E('button', { 'class': 'btn cbi-button-remove', - 'click': ui.createHandlerFn(view, 'handleDeleteModal', m, this.interfaces[i]) + 'click': ui.createHandlerFn(view, 'handleDeleteModal', m, this.interfaces[i]), + 'disabled': isReadonlyView }, [ _('Deleteā€¦') ]) ]); } -- cgit v1.2.3