Authentication: AuthFilter::allow_index_creation both check that the index is authorized and the IndexCreate action

This commit is contained in:
Louis Dureuil 2023-02-22 12:13:53 +01:00
parent 690bb2e5cc
commit 14c4a222da
No known key found for this signature in database
4 changed files with 11 additions and 10 deletions

View file

@ -173,8 +173,8 @@ impl Default for AuthFilter {
impl AuthFilter {
#[inline]
pub fn allow_index_creation(&self) -> bool {
self.allow_index_creation
pub fn allow_index_creation(&self, index: &str) -> bool {
self.allow_index_creation && self.is_index_authorized(index)
}
pub fn with_allowed_indexes(allowed_indexes: HashSet<IndexUidPattern>) -> Self {