Trait casbin::Model[][src]

pub trait Model: Send + Sync {
Show 15 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>>);
}

Required methods

Implementors