Skip to content

Commit

Permalink
🐛 fix: miss auth check (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwnmengjing authored Jul 4, 2024
1 parent 233ed12 commit 5ee6aa2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/response/actions/gorm/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (e *Control) Handler() gin.HandlersChain {
if e.opts.controlHandlers != nil {
chain = append(e.opts.controlHandlers, chain...)
}
if e.opts.Handlers != nil {
if e.opts.handlers != nil {
chain = append(e.opts.handlers, chain...)
}
return chain
Expand Down
2 changes: 1 addition & 1 deletion pkg/response/actions/gorm/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (e *Delete) Handler() gin.HandlersChain {
if e.opts.deleteHandlers != nil {
chain = append(e.opts.deleteHandlers, chain...)
}
if e.opts.Handlers != nil {
if e.opts.handlers != nil {
chain = append(e.opts.handlers, chain...)
}
return chain
Expand Down
2 changes: 1 addition & 1 deletion pkg/response/actions/gorm/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (e *Get) Handler() gin.HandlersChain {
if e.opts.getHandlers != nil {
chain = append(e.opts.getHandlers, chain...)
}
if e.opts.Handlers != nil {
if e.opts.handlers != nil {
chain = append(e.opts.handlers, chain...)
}
return chain
Expand Down
3 changes: 1 addition & 2 deletions pkg/response/actions/gorm/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ type Option func(*Options)
type Options struct {
Model schema.Tabler
Scope func(ctx *gin.Context, table schema.Tabler) func(db *gorm.DB) *gorm.DB
Handlers gin.HandlersChain
TreeField string
Depth int
Key string
Expand Down Expand Up @@ -62,7 +61,7 @@ func WithScope(scope func(ctx *gin.Context, table schema.Tabler) func(db *gorm.D

func WithHandlers(handlers gin.HandlersChain) Option {
return func(o *Options) {
o.Handlers = handlers
o.handlers = handlers
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/response/actions/gorm/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (e *Search) Handler() gin.HandlersChain {
if e.opts.searchHandlers != nil {
chain = append(e.opts.searchHandlers, chain...)
}
if e.opts.Handlers != nil {
if e.opts.handlers != nil {
chain = append(e.opts.handlers, chain...)
}
return chain
Expand Down

0 comments on commit 5ee6aa2

Please sign in to comment.