filter

package
v0.0.0-...-79cb864 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthorizer

func NewAuthorizer(e *casbin.Enforcer, sessionOn bool) beego.FilterFunc

NewAuthorizer returns the authorizer. Use a casbin enforcer as input

Types

type BasicAuthorizer

type BasicAuthorizer struct {
	// contains filtered or unexported fields
}

BasicAuthorizer stores the casbin handler

func (*BasicAuthorizer) CheckPermission

func (a *BasicAuthorizer) CheckPermission(r *http.Request) bool

CheckPermission checks the user/method/path combination from the request. Returns true (permission granted) or false (permission forbidden)

func (*BasicAuthorizer) InternalServerError

func (a *BasicAuthorizer) InternalServerError(ctx *context.Context)

InternalServerError returns the 500 to the client

func (*BasicAuthorizer) RequireLogin

func (a *BasicAuthorizer) RequireLogin(ctx *context.Context)

RequireLogin returns the 302 Redirect to the client

func (*BasicAuthorizer) RequirePermission

func (a *BasicAuthorizer) RequirePermission(ctx *context.Context)

RequirePermission returns the 403 Forbidden to the client

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL