casbin / casbin-pg-adapter

A go-pg adapter for casbin
https://github.com/casbin/casbin
Apache License 2.0
38 stars 28 forks source link

fix: update UpdateFilteredPolicies method #34

Closed tangyang9464 closed 3 years ago

tangyang9464 commented 3 years ago

Signed-off-by: tangyang9464 tangyang9464@163.com

fix: #33

hsluoyz commented 3 years ago

@antipopp plz review.

antipopp commented 3 years ago

It works only once in my setup. The first time I run:

_, err := enforcer.UpdatePolicy([]string{"admin", "domain1", "users", "allow"}, []string{"admin", "domain1", "users", "deny"})
    if err != nil {
        return err
    }

it works, but then if I run:

_, err := enforcer.UpdatePolicy([]string{"admin", "domain1", "users", "deny"}, []string{"admin", "domain1", "users", "allow"})
    if err != nil {
        return err
    }

the function still returns true and no errors, but nothing changes in the DB.

tangyang9464 commented 3 years ago

@antipopp fixed.

antipopp commented 3 years ago

works as intended, thank you!

github-actions[bot] commented 3 years ago

:tada: This PR is included in version 1.0.3 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: