Versions in this module Expand all Collapse all v1 v1.0.3 Apr 27, 2024 Changes in this version + var ErrSubFnNil = errors.New("subFn is nil") + type CasbinMiddleware struct + func NewCasbinMiddleware(modelFile string, policyAdapter interface{}, subFn SubjectFn) (*CasbinMiddleware, error) + func NewCasbinMiddlewareFromEnforcer(e *casbin.Enforcer, subFn SubjectFn) (*CasbinMiddleware, error) + func (am *CasbinMiddleware) RequiresPermissions(permissions []string, opts ...Option) gin.HandlerFunc + func (am *CasbinMiddleware) RequiresRoles(requiredRoles []string, opts ...Option) gin.HandlerFunc + type Logic int + const AND + const OR + type Option interface + func WithLogic(logic Logic) Option + type SubjectFn func(c *gin.Context) string