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:17:13 +0000 (17:17 +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>
(cherry picked from commit 9922c838cd1abcda60f4e93b89b0c52a101fc667)

applications/luci-app-acl/htdocs/luci-static/resources/view/system/acl.js

index 618facd6e64c45e9d4b2c8ed59319fa1ecea0430..4d3c98d5b698015981de68b5dd32255cd299c809 100644 (file)
@@ -319,12 +319,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;
                        }