Add upg to radius

This commit is contained in:
William Brown 2020-05-13 14:13:25 +10:00 committed by Firstyear
parent 8a4d524d54
commit ff8711592e

View file

@ -22,7 +22,15 @@ pub struct Group {
macro_rules! try_from_account_e {
($au:expr, $value:expr, $qs:expr) => {{
let groups: Vec<Group> = match $value.get_ava_reference_uuid("memberof") {
let name = $value.get_ava_single_string("name").ok_or_else(|| {
OperationError::InvalidAccountState("Missing attribute: name".to_string())
})?;
let uuid = *$value.get_uuid();
let upg = Group { name, uuid };
let mut groups: Vec<Group> = match $value.get_ava_reference_uuid("memberof") {
Some(l) => {
// given a list of uuid, make a filter: even if this is empty, the be will
// just give and empty result set.
@ -48,6 +56,7 @@ macro_rules! try_from_account_e {
vec![]
}
};
groups.push(upg);
Ok(groups)
}};
}