Fix the /swap-indexes route API

1. payload
2. error messages
3. auth errors
This commit is contained in:
Loïc Lecrenier 2022-10-24 14:49:39 +02:00 committed by Clément Renault
parent 92c41f0ef6
commit 2808be9d45
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
6 changed files with 140 additions and 73 deletions

View file

@ -26,7 +26,7 @@ pub static AUTHORIZATIONS: Lazy<HashMap<(&'static str, &'static str), HashSet<&'
("DELETE", "/indexes/products/") => hashset!{"indexes.delete", "indexes.*", "*"},
("POST", "/indexes") => hashset!{"indexes.create", "indexes.*", "*"},
("GET", "/indexes") => hashset!{"indexes.get", "indexes.*", "*"},
// ("POST", "/indexes-swap") => hashset!{"indexes.swap", "indexes.*", "*"}, // TODO: uncomment and fix this test
("POST", "/swap-indexes") => hashset!{"indexes.swap", "indexes.*", "*"},
("GET", "/indexes/products/settings") => hashset!{"settings.get", "settings.*", "*"},
("GET", "/indexes/products/settings/displayed-attributes") => hashset!{"settings.get", "settings.*", "*"},
("GET", "/indexes/products/settings/distinct-attribute") => hashset!{"settings.get", "settings.*", "*"},