mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2026-03-29 23:20:23 -04:00
feat: added functions to remove, add and lsit acls (with filtering)
This commit is contained in:
parent
f1d725c842
commit
13e497936f
3 changed files with 52 additions and 5 deletions
|
|
@ -1,3 +1,5 @@
|
|||
use std::collections::HashSet;
|
||||
|
||||
use serde::{Serialize, Deserialize};
|
||||
use url::Host;
|
||||
|
||||
|
|
@ -10,14 +12,17 @@ pub trait Data: Send + Sync {
|
|||
fn add_acl(&self, acl: AclDatabaseEntry) -> crate::Result<()>;
|
||||
/// remove a given Acl entry from the database
|
||||
fn remove_acl(&self,host: Host<String>) -> crate::Result<()>;
|
||||
|
||||
/// list all acls
|
||||
fn get_all_acls(&self) -> HashSet<AclDatabaseEntry>;
|
||||
}
|
||||
|
||||
#[derive(Serialize,Deserialize, Debug, Clone, Copy)]
|
||||
#[derive(Serialize,Deserialize, Debug, Clone, Copy, Hash, Eq, PartialEq)]
|
||||
pub enum AclMode{
|
||||
Block,
|
||||
Allow
|
||||
}
|
||||
#[derive(Serialize,Deserialize, Debug, Clone)]
|
||||
#[derive(Serialize,Deserialize, Debug, Clone, Hash, Eq,PartialEq)]
|
||||
|
||||
pub struct AclDatabaseEntry {
|
||||
pub(crate) mode: AclMode,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue