(init) Identity Module
This commit is contained in:
parent
45564cceed
commit
422cd93303
3 changed files with 50 additions and 2 deletions
src/core
36
src/core/identity.rs
Normal file
36
src/core/identity.rs
Normal file
|
@ -0,0 +1,36 @@
|
|||
|
||||
use std::collections::HashMap;
|
||||
|
||||
fn adminvector() -> Vec<String> {
|
||||
vec![String::from("ModulatingForce")]
|
||||
}
|
||||
|
||||
|
||||
enum userRole {
|
||||
Chatter,
|
||||
Mod(String), // String specifies Channel
|
||||
SupMod(String), // String specifies Channel
|
||||
Broadcaster,
|
||||
BotAdmin,
|
||||
}
|
||||
|
||||
|
||||
pub struct IdentityManager {
|
||||
specialRolesUsers : HashMap<String,Vec<userRole>>,
|
||||
}
|
||||
|
||||
|
||||
impl IdentityManager {
|
||||
|
||||
pub fn init() -> IdentityManager {
|
||||
let mut a = HashMap::new();
|
||||
for admn in adminvector() {
|
||||
a.insert(admn.to_lowercase(),vec![userRole::BotAdmin]);
|
||||
};
|
||||
|
||||
IdentityManager {
|
||||
specialRolesUsers : a,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue