luci-mod-system: password.js: make readonly on insufficient ACLs
authorJo-Philipp Wich <jo@mein.io>
Thu, 16 Apr 2020 13:36:39 +0000 (15:36 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 16 Apr 2020 13:36:39 +0000 (15:36 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-system/htdocs/luci-static/resources/view/system/password.js

index 2b79633cac1deb9cf574ad5923a401fe8f1a1333..f3275606ce480c836393d985625cc4f942ba9f04 100644 (file)
@@ -44,6 +44,8 @@ return view.extend({
                var m, s, o;
 
                m = new form.JSONMap(formData, _('Router Password'), _('Changes the administrator password for accessing the device'));
+               m.readonly = !L.hasViewPermission();
+
                s = m.section(form.NamedSection, 'password', 'password');
 
                o = s.option(form.Value, 'pw1', _('Password'));