diff --git a/src/cmd/acl.rs b/src/cmd/acl.rs index 69632304036831b8c366c8b66dd4e11ba795bba0..527cd4a18de4fc7e43985f6a71fd3b08b008c670 100644 --- a/src/cmd/acl.rs +++ b/src/cmd/acl.rs @@ -121,10 +121,10 @@ impl CmdAcl { } fn from_string_item(string: &str) -> CmdAcl { - if string == "ADMINONLY" { + if string.to_uppercase() == "ADMINONLY" { CmdAcl::AdminOnly - } else if string.starts_with("ROOM!") { - let room = string.strip_prefix("ROOM").unwrap().to_string(); + } else if string.to_uppercase().starts_with("ROOM!") { + let room = (&string[4..]).to_string(); CmdAcl::RoomOnly(room) } else { error!("Unknown ACL: {}", string); @@ -135,7 +135,6 @@ impl CmdAcl { #[allow(dead_code)] pub fn from_string(string: String) -> CmdAcl { let acl_list = string - .to_uppercase() .split(",") .map(|x| CmdAcl::from_string_item(x.trim())) .collect::<Vec<CmdAcl>>();