notify: add wrapper for get_referenced_entities

The function returns all other entities referenced by a filter/target.
This is useful for permission checks, where the user must have the
appropriate permissions for all entities.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
This commit is contained in:
Lukas Wagner 2023-07-20 16:32:02 +02:00 committed by Wolfgang Bumiller
parent de59ffe4ec
commit 69d2eb953d

View File

@ -548,4 +548,13 @@ mod export {
let mut config = this.config.lock().unwrap();
api::filter::delete_filter(&mut config, name)
}
#[export]
fn get_referenced_entities(
#[try_from_ref] this: &NotificationConfig,
name: &str,
) -> Result<Vec<String>, ApiError> {
let config = this.config.lock().unwrap();
api::common::get_referenced_entities(&config, name)
}
}