Enum to discriminate primary and reg. memberships
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
extern crate umanux;
|
||||
use umanux::api::GroupRead;
|
||||
use umanux::api::UserDBRead;
|
||||
|
||||
fn main() {
|
||||
@@ -13,5 +14,23 @@ fn main() {
|
||||
|
||||
for u in db.get_all_users() {
|
||||
println!("{}", u);
|
||||
println!(
|
||||
"Groups: {:?}",
|
||||
u.get_groups()
|
||||
.iter()
|
||||
.map(|group| {
|
||||
(
|
||||
format!("{:?}", group.0),
|
||||
group.1.borrow().get_groupname().unwrap().to_owned(),
|
||||
)
|
||||
})
|
||||
.collect::<Vec<(String, String)>>()
|
||||
);
|
||||
}
|
||||
|
||||
for group in db.get_all_groups() {
|
||||
let gp = group.borrow();
|
||||
println!("{}", gp);
|
||||
println!("{:?}", gp.get_member_names())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user