Bug 25482: Wrong permissions specification for adv editor macros
authorTomas Cohen Arazi <tomascohen@theke.io>
Wed, 13 May 2020 22:07:17 +0000 (19:07 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 15 May 2020 11:47:08 +0000 (12:47 +0100)
The current permissions are defined as a hash, with a duplicate key.
This is generally invalid, but Debian 9's Mojolicious::Plugin::OpenAPI
lets it go through, even though the results are, random?

This patch sets the required permissions right, and following the
haspermissions() syntax correctly.

Tests for searching macros are not passing. Still trying to figure.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

api/v1/swagger/paths/advancededitormacros.json

index 120d14d..2fa8f20 100644 (file)
       },
       "x-koha-authorization": {
         "permissions": {
-          "editcatalogue": "advanced_editor",
-          "editcatalogue": "create_shared_macros"
+          "editcatalogue": {
+            "advanced_editor": 1,
+            "create_shared_macros": 1
+          }
         }
       }
     }
       },
       "x-koha-authorization": {
         "permissions": {
-          "editcatalogue": "advanced_editor",
-          "editcatalogue": "create_shared_macros"
+          "editcatalogue": {
+            "advanced_editor": 1,
+            "create_shared_macros": 1
+          }
         }
       }
     },
       },
       "x-koha-authorization": {
         "permissions": {
-          "editcatalogue": "advanced_editor",
-          "editcatalogue": "delete_shared_macros"
+          "editcatalogue": {
+            "advanced_editor": 1,
+            "delete_shared_macros": 1
+          }
         }
       }
     }