Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Authorizer ¶
type Authorizer struct {
// contains filtered or unexported fields
}
func NewAuthorizer ¶
func NewAuthorizer(enforcer enforcer.Enforcer) *Authorizer
func (*Authorizer) AuthorizationMiddleware ¶
func (a *Authorizer) AuthorizationMiddleware(next http.Handler) http.Handler
AuthorizationMiddleware is a middleware that checks if the request is authorized.
func (*Authorizer) GetPermission ¶ added in v1.10.0
func (a *Authorizer) GetPermission(requestPath string, requestMethod string) string
GetPermission returns the permission required to authorized a request. It's assumed that permission to request is a one to one mapping.
func (*Authorizer) RequireAuthorization ¶ added in v1.10.0
func (a *Authorizer) RequireAuthorization(requestPath string, requestMethod string) bool
RequireAuthorization returns true if the request requires authorization.
Click to show internal directories.
Click to hide internal directories.