diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-04-16 15:35:13 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-04-16 15:35:13 +0200 |
commit | 684f7dd7dc21e61a73ecf20f9e6e158af39872a6 (patch) | |
tree | e64028f75a9d00376cf53638e45f09b97014fd17 /modules/luci-mod-system/htdocs/luci-static | |
parent | 92902225fbb36db4bc61ba9e08a88778763856f2 (diff) |
luci-mod-system: flash.js: make readonly on insufficient ACLs
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-system/htdocs/luci-static')
-rw-r--r-- | modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js index b058091f94..c1e1273772 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js @@ -6,6 +6,8 @@ 'require fs'; 'require ui'; +var isReadonlyView = !L.hasViewPermission(); + var callSystemValidateFirmwareImage = rpc.declare({ object: 'system', method: 'validate_firmware_image', @@ -353,6 +355,7 @@ return view.extend({ m = new form.JSONMap(mapdata, _('Flash operations')); m.tabbed = true; + m.readonly = isReadonlyView; s = m.section(form.NamedSection, 'actions', _('Actions')); @@ -422,7 +425,8 @@ return view.extend({ node.appendChild(E('div', { 'class': 'cbi-page-actions' }, [ E('button', { 'class': 'cbi-button cbi-button-save', - 'click': ui.createHandlerFn(view, 'handleBackupSave', this.map) + 'click': ui.createHandlerFn(view, 'handleBackupSave', this.map), + 'disabled': isReadonlyView }, [ _('Save') ]) ])); |