Skip to content

Commit e93795d

Browse files
committed
fix: fix addPolicyWithoutNotify() return value when adding duplicated policy
1 parent d4fc697 commit e93795d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal_api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (e *Enforcer) addPolicyWithoutNotify(sec string, ptype string, rule []strin
4242

4343
hasPolicy, err := e.model.HasPolicy(sec, ptype, rule)
4444
if hasPolicy || err != nil {
45-
return hasPolicy, err
45+
return false, err
4646
}
4747

4848
if e.shouldPersist() {

0 commit comments

Comments
 (0)