luci-mod-system: flash.js: make readonly on insufficient ACLs
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
92902225fb
commit
684f7dd7dc
1 changed files with 5 additions and 1 deletions
|
@ -6,6 +6,8 @@
|
||||||
'require fs';
|
'require fs';
|
||||||
'require ui';
|
'require ui';
|
||||||
|
|
||||||
|
var isReadonlyView = !L.hasViewPermission();
|
||||||
|
|
||||||
var callSystemValidateFirmwareImage = rpc.declare({
|
var callSystemValidateFirmwareImage = rpc.declare({
|
||||||
object: 'system',
|
object: 'system',
|
||||||
method: 'validate_firmware_image',
|
method: 'validate_firmware_image',
|
||||||
|
@ -353,6 +355,7 @@ return view.extend({
|
||||||
|
|
||||||
m = new form.JSONMap(mapdata, _('Flash operations'));
|
m = new form.JSONMap(mapdata, _('Flash operations'));
|
||||||
m.tabbed = true;
|
m.tabbed = true;
|
||||||
|
m.readonly = isReadonlyView;
|
||||||
|
|
||||||
s = m.section(form.NamedSection, 'actions', _('Actions'));
|
s = m.section(form.NamedSection, 'actions', _('Actions'));
|
||||||
|
|
||||||
|
@ -422,7 +425,8 @@ return view.extend({
|
||||||
node.appendChild(E('div', { 'class': 'cbi-page-actions' }, [
|
node.appendChild(E('div', { 'class': 'cbi-page-actions' }, [
|
||||||
E('button', {
|
E('button', {
|
||||||
'class': 'cbi-button cbi-button-save',
|
'class': 'cbi-button cbi-button-save',
|
||||||
'click': ui.createHandlerFn(view, 'handleBackupSave', this.map)
|
'click': ui.createHandlerFn(view, 'handleBackupSave', this.map),
|
||||||
|
'disabled': isReadonlyView
|
||||||
}, [ _('Save') ])
|
}, [ _('Save') ])
|
||||||
]));
|
]));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue