luci-app-acl: ensure to set read/write ACL presets as uci lists
authorJo-Philipp Wich <jo@mein.io>
Wed, 7 Jul 2021 14:48:09 +0000 (16:48 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 7 Jul 2021 15:15:37 +0000 (17:15 +0200)
The rpcd daemon expects uci list notation for the login.read and login.write
options, so ensure to set them accordingly when chosing the `full access` or
`readonly` presets while configuring an account.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
applications/luci-app-acl/htdocs/luci-static/resources/view/system/acl.js

index 8d1086f754b67cc216f3d76be4ad1679ec3b0ab1..7f86a298c130f434be0d539c4b552edbdc88612b 100644 (file)
@@ -322,12 +322,12 @@ return view.extend({
                o.write = function(section_id) {
                        switch (this.formvalue(section_id)) {
                        case 'write':
-                               uci.set('rpcd', section_id, 'read', '*');
-                               uci.set('rpcd', section_id, 'write', '*');
+                               uci.set('rpcd', section_id, 'read', ['*']);
+                               uci.set('rpcd', section_id, 'write', ['*']);
                                break;
 
                        case 'read':
-                               uci.set('rpcd', section_id, 'read', '*');
+                               uci.set('rpcd', section_id, 'read', ['*']);
                                uci.unset('rpcd', section_id, 'write');
                                break;
                        }