Documentation ¶
Index ¶
- func Username(ctx context.Context) (name string)
- type Casbin
- func (c *Casbin) Check(ctx context.Context) (ok bool)
- func (c *Casbin) CheckReq(r *http.Request) (ok bool)
- func (c *Casbin) Enabled() bool
- func (c *Casbin) Enforcer() *casbin.Enforcer
- func (c *Casbin) RegisterTo(app *iris.Application, optionalEnforcer *casbin.Enforcer)
- func (c *Casbin) ServeHTTP(ctx context.Context)
- func (c *Casbin) Wrapper() func(w http.ResponseWriter, r *http.Request, router http.HandlerFunc)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Casbin ¶
type Casbin struct {
// contains filtered or unexported fields
}
func (*Casbin) Check ¶
Check checks the username, request's method and path and returns true if permission grandted otherwise false.
func (*Casbin) RegisterTo ¶
func (c *Casbin) RegisterTo(app *iris.Application, optionalEnforcer *casbin.Enforcer)
func (*Casbin) Wrapper ¶
func (c *Casbin) Wrapper() func(w http.ResponseWriter, r *http.Request, router http.HandlerFunc)
Click to show internal directories.
Click to hide internal directories.