mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2026-03-29 23:20:23 -04:00
feat: added ACL commands
This commit is contained in:
parent
13e497936f
commit
90232b894d
3 changed files with 71 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
|||
use std::collections::HashSet;
|
||||
|
||||
use clap::ValueEnum;
|
||||
use serde::{Serialize, Deserialize};
|
||||
use url::Host;
|
||||
|
||||
|
|
@ -17,11 +18,20 @@ pub trait Data: Send + Sync {
|
|||
fn get_all_acls(&self) -> HashSet<AclDatabaseEntry>;
|
||||
}
|
||||
|
||||
#[derive(Serialize,Deserialize, Debug, Clone, Copy, Hash, Eq, PartialEq)]
|
||||
#[derive(Serialize,Deserialize, Debug, Clone, Copy, Hash, Eq, PartialEq, ValueEnum)]
|
||||
pub enum AclMode{
|
||||
Block,
|
||||
Allow
|
||||
}
|
||||
|
||||
impl AclMode {
|
||||
pub fn to_emoji(&self)-> char {
|
||||
match self {
|
||||
AclMode::Block => '❎',
|
||||
AclMode::Allow => '✅',
|
||||
}
|
||||
}
|
||||
}
|
||||
#[derive(Serialize,Deserialize, Debug, Clone, Hash, Eq,PartialEq)]
|
||||
|
||||
pub struct AclDatabaseEntry {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
|
||||
use std::{sync::Arc, collections::HashSet};
|
||||
use std::sync::Arc;
|
||||
|
||||
use ruma::ServerName;
|
||||
use tracing::{warn, debug, error};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue