Skip to content

Commit

Permalink
Merge pull request #7 from Neopallium/master
Browse files Browse the repository at this point in the history
Move creation of `BasicAuthorizer`
  • Loading branch information
hsluoyz authored Nov 16, 2018
2 parents 13cec14 + 87f814f commit cd3ed20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (

// NewAuthorizer returns the authorizer, uses a Casbin enforcer as input
func NewAuthorizer(e *casbin.Enforcer) gin.HandlerFunc {
return func(c *gin.Context) {
a := &BasicAuthorizer{enforcer: e}
a := &BasicAuthorizer{enforcer: e}

return func(c *gin.Context) {
if !a.CheckPermission(c.Request) {
a.RequirePermission(c)
}
Expand Down

0 comments on commit cd3ed20

Please sign in to comment.