From 92902225fbb36db4bc61ba9e08a88778763856f2 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 16 Apr 2020 15:33:02 +0200 Subject: luci-mod-system: crontab.js: disable textarea on insufficient ACLs Signed-off-by: Jo-Philipp Wich --- .../htdocs/luci-static/resources/view/system/crontab.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/luci-mod-system/htdocs/luci-static/resources') diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/crontab.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/crontab.js index 147b9830f0..939d41b0ec 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/crontab.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/crontab.js @@ -3,6 +3,8 @@ 'require fs'; 'require ui'; +var isReadonlyView = !L.hasViewPermission() || null; + return view.extend({ load: function() { return L.resolveDefault(fs.read('/etc/crontabs/root'), ''); @@ -25,7 +27,7 @@ return view.extend({ E('p', { 'class': 'cbi-section-descr' }, _('This is the system crontab in which scheduled tasks can be defined.') + _('
Note: you need to manually restart the cron service if the crontab file was empty before editing.')), - E('p', {}, E('textarea', { 'style': 'width:100%', 'rows': 10 }, [ crontab != null ? crontab : '' ])) + E('p', {}, E('textarea', { 'style': 'width:100%', 'rows': 10, 'disabled': isReadonlyView }, [ crontab != null ? crontab : '' ])) ]); }, -- cgit v1.2.3