Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCustomAuthorizer ¶
func NewCustomAuthorizer(e *casbin.Enforcer) gin.HandlerFunc
NewCustomAuthorizer returns a custom authorizer that uses a Casbin enforcer as input.
Types ¶
type CustomAuthorizer ¶
type CustomAuthorizer struct {
// contains filtered or unexported fields
}
CustomAuthorizer is a custom authorizer that checks roles in the Gin context for permissions.
func (*CustomAuthorizer) CheckPermission ¶
func (a *CustomAuthorizer) CheckPermission(c *gin.Context) bool
CheckPermission checks if the roles in the Gin context have permission for the requested URL and HTTP verb.
func (*CustomAuthorizer) RequirePermission ¶
func (a *CustomAuthorizer) RequirePermission(c *gin.Context)
RequirePermission returns the 403 Forbidden status to the client
Click to show internal directories.
Click to hide internal directories.