mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 12:05:05 +08:00
fix the api keys for the tasks route
This commit is contained in:
parent
ca4234b445
commit
1bef5d119d
@ -99,6 +99,7 @@ impl HeedAuthStore {
|
|||||||
Action::IndexesDelete,
|
Action::IndexesDelete,
|
||||||
Action::IndexesGet,
|
Action::IndexesGet,
|
||||||
Action::IndexesUpdate,
|
Action::IndexesUpdate,
|
||||||
|
Action::IndexesSwap,
|
||||||
]
|
]
|
||||||
.iter(),
|
.iter(),
|
||||||
);
|
);
|
||||||
@ -110,7 +111,7 @@ impl HeedAuthStore {
|
|||||||
actions.insert(Action::DumpsCreate);
|
actions.insert(Action::DumpsCreate);
|
||||||
}
|
}
|
||||||
Action::TasksAll => {
|
Action::TasksAll => {
|
||||||
actions.insert(Action::TasksGet);
|
actions.extend([Action::TasksGet, Action::TasksDelete, Action::TasksCancel]);
|
||||||
}
|
}
|
||||||
Action::StatsAll => {
|
Action::StatsAll => {
|
||||||
actions.insert(Action::StatsGet);
|
actions.insert(Action::StatsGet);
|
||||||
|
@ -36,7 +36,7 @@ pub async fn indexes_swap(
|
|||||||
let mut swaps = vec![];
|
let mut swaps = vec![];
|
||||||
let mut indexes_set = HashSet::<String>::default();
|
let mut indexes_set = HashSet::<String>::default();
|
||||||
for IndexesSwapPayload { indexes: (lhs, rhs) } in params.into_inner().into_iter() {
|
for IndexesSwapPayload { indexes: (lhs, rhs) } in params.into_inner().into_iter() {
|
||||||
if !search_rules.is_index_authorized(&lhs) || !search_rules.is_index_authorized(&lhs) {
|
if !search_rules.is_index_authorized(&lhs) || !search_rules.is_index_authorized(&rhs) {
|
||||||
return Err(ResponseError::from_msg(
|
return Err(ResponseError::from_msg(
|
||||||
"TODO: error message when we swap with an index were not allowed to access"
|
"TODO: error message when we swap with an index were not allowed to access"
|
||||||
.to_owned(),
|
.to_owned(),
|
||||||
|
@ -24,9 +24,9 @@ pub static AUTHORIZATIONS: Lazy<HashMap<(&'static str, &'static str), HashSet<&'
|
|||||||
("PATCH", "/indexes/products/") => hashset!{"indexes.update", "indexes.*", "*"},
|
("PATCH", "/indexes/products/") => hashset!{"indexes.update", "indexes.*", "*"},
|
||||||
("GET", "/indexes/products/") => hashset!{"indexes.get", "indexes.*", "*"},
|
("GET", "/indexes/products/") => hashset!{"indexes.get", "indexes.*", "*"},
|
||||||
("DELETE", "/indexes/products/") => hashset!{"indexes.delete", "indexes.*", "*"},
|
("DELETE", "/indexes/products/") => hashset!{"indexes.delete", "indexes.*", "*"},
|
||||||
("POST", "/indexes-swap") => hashset!{"indexes.swap", "indexes.*", "*"},
|
|
||||||
("POST", "/indexes") => hashset!{"indexes.create", "indexes.*", "*"},
|
("POST", "/indexes") => hashset!{"indexes.create", "indexes.*", "*"},
|
||||||
("GET", "/indexes") => hashset!{"indexes.get", "indexes.*", "*"},
|
("GET", "/indexes") => hashset!{"indexes.get", "indexes.*", "*"},
|
||||||
|
("POST", "/indexes-swap") => hashset!{"indexes.swap", "indexes.*", "*"},
|
||||||
("GET", "/indexes/products/settings") => hashset!{"settings.get", "settings.*", "*"},
|
("GET", "/indexes/products/settings") => hashset!{"settings.get", "settings.*", "*"},
|
||||||
("GET", "/indexes/products/settings/displayed-attributes") => hashset!{"settings.get", "settings.*", "*"},
|
("GET", "/indexes/products/settings/displayed-attributes") => hashset!{"settings.get", "settings.*", "*"},
|
||||||
("GET", "/indexes/products/settings/distinct-attribute") => hashset!{"settings.get", "settings.*", "*"},
|
("GET", "/indexes/products/settings/distinct-attribute") => hashset!{"settings.get", "settings.*", "*"},
|
||||||
|
Loading…
Reference in New Issue
Block a user