feat: added basic ACL functionality

This commit is contained in:
NinekoTheCat 2023-12-24 11:03:02 +01:00
parent 6a9f8dfa6f
commit 7562925aeb
No known key found for this signature in database
GPG key ID: 700DB3F678A4AB66
13 changed files with 183 additions and 4 deletions

View file

@ -6,7 +6,7 @@ use std::{
use lru_cache::LruCache;
use crate::{Config, Result};
pub mod acl;
pub mod account_data;
pub mod admin;
pub mod appservice;
@ -34,6 +34,7 @@ pub struct Services {
pub key_backups: key_backups::Service,
pub media: media::Service,
pub sending: Arc<sending::Service>,
pub acl: acl::Service
}
impl Services {
@ -49,11 +50,13 @@ impl Services {
+ key_backups::Data
+ media::Data
+ sending::Data
+ acl::Data
+ 'static,
>(
db: &'static D,
config: Config,
) -> Result<Self> {
let acl_conf = config.acl.clone();
Ok(Self {
appservice: appservice::Service { db },
pusher: pusher::Service { db },
@ -118,6 +121,7 @@ impl Services {
sending: sending::Service::build(db, &config),
globals: globals::Service::load(db, config)?,
acl: acl::Service { db: db, acl_config: acl_conf },
})
}
fn memory_usage(&self) -> String {