Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for casbin@0.3.0 #11

Closed
GopherJ opened this issue Feb 24, 2020 · 0 comments
Closed

add support for casbin@0.3.0 #11

GopherJ opened this issue Feb 24, 2020 · 0 comments

Comments

@GopherJ
Copy link
Member

GopherJ commented Feb 24, 2020

Currently diesel-adapter doesn't support casbin@0.3.0 because of breaking changes on Adapter trait.

Now it has tow more functions:

  1. remove_policies
  2. add_policies
#[async_trait]
pub trait Adapter: Send + Sync {
    async fn load_policy(&self, m: &mut dyn Model) -> Result<()>;
    async fn save_policy(&mut self, m: &mut dyn Model) -> Result<()>;
    async fn add_policy(&mut self, sec: &str, ptype: &str, rule: Vec<&str>) -> Result<bool>;
    async fn add_policies(&mut self, sec: &str, ptype: &str, rules: Vec<Vec<&str>>)
        -> Result<bool>;
    async fn remove_policy(&mut self, sec: &str, ptype: &str, rule: Vec<&str>) -> Result<bool>;
    async fn remove_policies(
        &mut self,
        sec: &str,
        ptype: &str,
        rules: Vec<Vec<&str>>,
    ) -> Result<bool>;
    async fn remove_filtered_policy(
        &mut self,
        sec: &str,
        ptype: &str,
        field_index: usize,
        field_values: Vec<&str>,
    ) -> Result<bool>;
}

see also: casbin/casbin-rs#55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant