casbin

Trait Model

Source
pub trait Model: Send + Sync {
Show 16 methods // Required methods fn add_def(&mut self, sec: &str, key: &str, value: &str) -> bool; fn get_model(&self) -> &HashMap<String, LinkedHashMap<String, Assertion>>; fn get_mut_model( &mut self, ) -> &mut HashMap<String, LinkedHashMap<String, Assertion>>; fn build_role_links( &mut self, rm: Arc<RwLock<dyn RoleManager>>, ) -> Result<()>; fn build_incremental_role_links( &mut self, rm: Arc<RwLock<dyn RoleManager>>, d: EventData, ) -> Result<()>; fn add_policy(&mut self, sec: &str, ptype: &str, rule: Vec<String>) -> bool; fn add_policies( &mut self, sec: &str, ptype: &str, rules: Vec<Vec<String>>, ) -> bool; fn get_policy(&self, sec: &str, ptype: &str) -> Vec<Vec<String>>; fn get_filtered_policy( &self, sec: &str, ptype: &str, field_index: usize, field_values: Vec<String>, ) -> Vec<Vec<String>>; fn has_policy(&self, sec: &str, ptype: &str, rule: Vec<String>) -> bool; fn get_values_for_field_in_policy( &self, sec: &str, ptype: &str, field_index: usize, ) -> Vec<String>; fn remove_policy( &mut self, sec: &str, ptype: &str, rule: Vec<String>, ) -> bool; fn remove_policies( &mut self, sec: &str, ptype: &str, rules: Vec<Vec<String>>, ) -> bool; fn clear_policy(&mut self); fn remove_filtered_policy( &mut self, sec: &str, ptype: &str, field_index: usize, field_values: Vec<String>, ) -> (bool, Vec<Vec<String>>); fn to_text(&self) -> String;
}

Required Methods§

Source

fn add_def(&mut self, sec: &str, key: &str, value: &str) -> bool

Source

fn get_model(&self) -> &HashMap<String, LinkedHashMap<String, Assertion>>

Source

fn get_mut_model( &mut self, ) -> &mut HashMap<String, LinkedHashMap<String, Assertion>>

Source

fn add_policy(&mut self, sec: &str, ptype: &str, rule: Vec<String>) -> bool

Source

fn add_policies( &mut self, sec: &str, ptype: &str, rules: Vec<Vec<String>>, ) -> bool

Source

fn get_policy(&self, sec: &str, ptype: &str) -> Vec<Vec<String>>

Source

fn get_filtered_policy( &self, sec: &str, ptype: &str, field_index: usize, field_values: Vec<String>, ) -> Vec<Vec<String>>

Source

fn has_policy(&self, sec: &str, ptype: &str, rule: Vec<String>) -> bool

Source

fn get_values_for_field_in_policy( &self, sec: &str, ptype: &str, field_index: usize, ) -> Vec<String>

Source

fn remove_policy(&mut self, sec: &str, ptype: &str, rule: Vec<String>) -> bool

Source

fn remove_policies( &mut self, sec: &str, ptype: &str, rules: Vec<Vec<String>>, ) -> bool

Source

fn clear_policy(&mut self)

Source

fn remove_filtered_policy( &mut self, sec: &str, ptype: &str, field_index: usize, field_values: Vec<String>, ) -> (bool, Vec<Vec<String>>)

Source

fn to_text(&self) -> String

Implementors§