|
|
|
@ -44,6 +44,7 @@ impl UserMap { |
|
|
|
|
|
|
|
/// Looks up the given user name in the map, returning an immutable
|
|
|
|
/// reference to the associated data if found.
|
|
|
|
#[cfg(test)]
|
|
|
|
pub fn get(&self, user_name: &str) -> Option<&User> {
|
|
|
|
self.map.get(user_name)
|
|
|
|
}
|
|
|
|
@ -97,6 +98,7 @@ impl UserMap { |
|
|
|
}
|
|
|
|
|
|
|
|
/// Returns a copy of the set of privileged users.
|
|
|
|
#[cfg(test)]
|
|
|
|
pub fn get_all_privileged(&self) -> Vec<String> {
|
|
|
|
self.privileged.iter().map(|s| s.to_string()).collect()
|
|
|
|
}
|
|
|
|
@ -112,6 +114,7 @@ impl UserMap { |
|
|
|
}
|
|
|
|
|
|
|
|
/// Checks if the given user is privileged.
|
|
|
|
#[cfg(test)]
|
|
|
|
pub fn is_privileged(&self, user_name: &str) -> bool {
|
|
|
|
self.privileged.contains(user_name)
|
|
|
|
}
|
|
|
|
|