Documentation ¶
Index ¶
- func BlacklistCheck(next http.Handler, e *common.Environment, devices stores.DeviceStore, ...) http.Handler
- func Cache(next http.Handler, e *common.Environment) http.Handler
- func CheckAdmin(next http.Handler) http.Handler
- func CheckAuth(next http.Handler) http.Handler
- func CheckAuthAPI(next http.Handler, users stores.UserStore) http.Handler
- func CheckGuestReg(next http.Handler, e *common.Environment, leases stores.LeaseStore) http.Handler
- func CheckPermissions(next httprouter.Handle, checker PermissionChecker) httprouter.Handle
- func Logging(next http.Handler, e *common.Environment) http.Handler
- func Panic(next http.Handler, e *common.Environment) http.Handler
- func SetSessionInfo(next http.Handler, e *common.Environment, users stores.UserStore) http.Handler
- type PermissionChecker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlacklistCheck ¶ added in v0.8.0
func BlacklistCheck(next http.Handler, e *common.Environment, devices stores.DeviceStore, leases stores.LeaseStore) http.Handler
func CheckAuth ¶
CheckAuth is middleware to check if a user is logged in, if not it will redirect to the login page
func CheckAuthAPI ¶ added in v1.2.0
CheckAuth is middleware to check if a user is logged in, if not it will redirect to the login page
func CheckGuestReg ¶ added in v0.14.0
func CheckGuestReg(next http.Handler, e *common.Environment, leases stores.LeaseStore) http.Handler
func CheckPermissions ¶ added in v1.5.0
func CheckPermissions(next httprouter.Handle, checker PermissionChecker) httprouter.Handle
CheckPermissions middleware ensures a session user has the required permissions to fulfill the request.
func SetSessionInfo ¶
Types ¶
type PermissionChecker ¶ added in v1.5.0
A PermissionChecker takes a request and a user and determines if the user has sufficient permissions to perform the request.
func PermsCanAny ¶ added in v1.5.0
func PermsCanAny(permissions ...models.Permission) PermissionChecker
PermsCanAny returns a permission checker that checks if the user can perform any of the supplied permissions. If any permission is allowed, the request is allowed.
Click to show internal directories.
Click to hide internal directories.