mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
feat: Fully ignore ACLs that deny everyone
This commit is contained in:
@@ -25,10 +25,8 @@ pub async fn acl_check(&self, server_name: &ServerName, room_id: &RoomId) -> Res
|
|||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
if acl_event_content.deny.contains(&String::from("*"))
|
if acl_event_content.deny.contains(&String::from("*")) || acl_event_content.deny.is_empty() {
|
||||||
&& acl_event_content.allow.contains(&String::from("*"))
|
warn!(%room_id, "Ignoring broken ACL event (everyone is banned)");
|
||||||
{
|
|
||||||
warn!(%room_id, "Ignoring broken ACL event (allow key and deny key both contain wildcard \"*\"");
|
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,12 +34,6 @@ pub async fn acl_check(&self, server_name: &ServerName, room_id: &RoomId) -> Res
|
|||||||
trace!("server {server_name} is allowed by ACL");
|
trace!("server {server_name} is allowed by ACL");
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
if acl_event_content.deny.contains(&String::from("*"))
|
|
||||||
&& server_name == self.services.globals.server_name()
|
|
||||||
{
|
|
||||||
warn!(%room_id, "Ignoring broken ACL event that denies everyone");
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
debug!("Server {server_name} was denied by room ACL in {room_id}");
|
debug!("Server {server_name} was denied by room ACL in {room_id}");
|
||||||
Err!(Request(Forbidden("Server was denied by room ACL")))
|
Err!(Request(Forbidden("Server was denied by room ACL")))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user