use crate::bindings::vtx::api::{vtx_auth_types::CurrentUser, vtx_context};
pub type CurrentUserInfo = CurrentUser;
pub fn current_user() -> Option<CurrentUser> {
vtx_context::get_current_user()
}
pub trait CurrentUserExt {
fn is_in_group(&self, group: &str) -> bool;
}
impl CurrentUserExt for CurrentUser {
fn is_in_group(&self, group: &str) -> bool {
self.groups.iter().any(|g| g == group)
}
}