Skip to content

Commit

Permalink
Rename to Filter.Ptype
Browse files Browse the repository at this point in the history
  • Loading branch information
hsluoyz committed Apr 17, 2021
1 parent 5d2303c commit fa4239f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (CasbinRule) TableName() string {
}

type Filter struct {
PType []string
Ptype []string
V0 []string
V1 []string
V2 []string
Expand Down Expand Up @@ -399,8 +399,8 @@ func (a *Adapter) IsFiltered() bool {
// filterQuery builds the gorm query to match the rule filter to use within a scope.
func (a *Adapter) filterQuery(db *gorm.DB, filter Filter) func(db *gorm.DB) *gorm.DB {
return func(db *gorm.DB) *gorm.DB {
if len(filter.PType) > 0 {
db = db.Where("ptype in (?)", filter.PType)
if len(filter.Ptype) > 0 {
db = db.Where("ptype in (?)", filter.Ptype)
}
if len(filter.V0) > 0 {
db = db.Where("v0 in (?)", filter.V0)
Expand Down

0 comments on commit fa4239f

Please sign in to comment.