This commit is contained in:
2026-08-16 20:58:57 +08:00
parent a85477be80
commit a9e1f9e6f8
42 changed files with 1569 additions and 156 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ func newPolicyRule(authorityID uint, path, method string) casbinRulePO {
}
func policyScope(db *gorm.DB) *gorm.DB {
return db.Where("ptype = ?", "p")
return db.Session(&gorm.Session{NewDB: true}).Model(&casbinRulePO{}).Where("ptype = ?", "p")
}
func deletePoliciesForAuthority(db *gorm.DB, authorityID uint) error {