mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2026-03-29 23:20:23 -04:00
feat: added basic ACL functionality
This commit is contained in:
parent
6a9f8dfa6f
commit
7562925aeb
13 changed files with 183 additions and 4 deletions
|
|
@ -1645,6 +1645,17 @@ impl Service {
|
|||
|
||||
/// Returns Ok if the acl allows the server
|
||||
pub fn acl_check(&self, server_name: &ServerName, room_id: &RoomId) -> Result<()> {
|
||||
if !services().acl.is_federation_with_allowed_server_name(server_name) {
|
||||
info!(
|
||||
"Server {} was denied by server ACL in {}",
|
||||
server_name, room_id
|
||||
);
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::Forbidden,
|
||||
"Server was denied by Server ACL",
|
||||
));
|
||||
}
|
||||
|
||||
let acl_event = match services().rooms.state_accessor.room_state_get(
|
||||
room_id,
|
||||
&StateEventType::RoomServerAcl,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue