product-config: export get_api_user

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
Dietmar Maurer 2024-06-04 11:02:23 +02:00
parent 3aa07c117b
commit 0033f67e37

View File

@ -15,8 +15,12 @@ pub fn init(api_user: nix::unistd::User) {
}
}
/// Returns the global product configuration (see [init_product_config])
pub(crate) fn get_api_user() -> &'static nix::unistd::User {
/// Returns the global api_user set with [init].
///
/// # Panics
///
/// Panics if [init] wasn't called before.
pub fn get_api_user() -> &'static nix::unistd::User {
unsafe {
&PRODUCT_CONFIG
.as_ref()