Skip to content

Commit

Permalink
fix: checks has policy (#657)
Browse files Browse the repository at this point in the history
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
  • Loading branch information
nodece committed Dec 2, 2020
1 parent 4d25cce commit 330f372
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion enforcer_distributed.go
Expand Up @@ -26,7 +26,7 @@ func NewDistributedEnforcer(params ...interface{}) (*DistributedEnforcer, error)
func (d *DistributedEnforcer) AddPolicySelf(shouldPersist func() bool, sec string, ptype string, rules [][]string) (effects [][]string, err error) {
var noExistsPolicy [][]string
for _, rule := range rules {
if !d.HasPolicy(sec, ptype, rule) {
if !d.model.HasPolicy(sec, ptype, rule) {
noExistsPolicy = append(noExistsPolicy, rule)
}
}
Expand Down

0 comments on commit 330f372

Please sign in to comment.