summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-system/htdocs/luci-static/resources
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-04-16 15:33:02 +0200
committerJo-Philipp Wich <jo@mein.io>2020-04-16 15:33:02 +0200
commit92902225fbb36db4bc61ba9e08a88778763856f2 (patch)
tree382cdbdb76074f4f004dddaf1055aa7f343a2ff1 /modules/luci-mod-system/htdocs/luci-static/resources
parent17770e49ebb2ef7c9c348aa69146e33988f69720 (diff)
luci-mod-system: crontab.js: disable textarea on insufficient ACLs
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-system/htdocs/luci-static/resources')
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/crontab.js4
1 files changed, 3 insertions, 1 deletions
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 147b9830f..939d41b0e 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.') +
_('<br/>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 : '' ]))
]);
},