Skip to content

Commit

Permalink
fix: fix broken links (#220)
Browse files Browse the repository at this point in the history
* fix: fix broken links

* Update adapter.go

---------

Co-authored-by: hsluoyz <hsluoyz@qq.com>
  • Loading branch information
Selflocking and hsluoyz committed Aug 8, 2023
1 parent a7eb1c1 commit bb83b9a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ func (a *Adapter) AddPolicy(sec string, ptype string, rule []string) error {
// RemovePolicy removes a policy rule from the storage.
func (a *Adapter) RemovePolicy(sec string, ptype string, rule []string) error {
line := a.savePolicyLine(ptype, rule)
err := a.rawDelete(a.db, line) //can't use db.Delete as we're not using primary key http://jinzhu.me/gorm/crud.html#delete
err := a.rawDelete(a.db, line) //can't use db.Delete as we're not using primary key https://gorm.io/docs/update.html
return err
}

Expand Down Expand Up @@ -687,8 +687,7 @@ func (a *Adapter) RemovePolicies(sec string, ptype string, rules [][]string) err
return a.db.Transaction(func(tx *gorm.DB) error {
for _, rule := range rules {
line := a.savePolicyLine(ptype, rule)
if err := a.rawDelete(tx, line); err != nil { //can't use db.Delete as we're not using primary key http://jinzhu.me/gorm/crud.html#delete
return err
if err := a.rawDelete(tx, line); err != nil { //can't use db.Delete as we're not using primary key https://gorm.io/docs/update.html
}
}
return nil
Expand Down

0 comments on commit bb83b9a

Please sign in to comment.