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
Click to show internal directories.
Click to hide internal directories.