Middleware

This package contains custom middlewares, see Middleware and Middleware.

Access Control Middleware

class ycms.core.middleware.access_control_middleware.AccessControlMiddleware(get_response)

Bases: object

Middleware class that performs a basic access control. For urls that are whitelisted (see whitelist), no additional rules are enforced. For all other urls, the user has to be logged in.

__init__(get_response)

Initialize the middleware for the current view

Parameters:

get_response (Callable) – A callable to get the response for the current request

Timetravel Middleware

class ycms.core.middleware.timetravel_middleware.TimetravelMiddleware(get_response)

Bases: object

Middleware class that performs “timetravelling”. If no “time” parameter is included in the request, no action is taken. If the parameter is present, the request object is stored in a local thread for use by the TimetravelManager.

__init__(get_response)

Initialize the middleware for the current view

Parameters:

get_response (Callable) – A callable to get the response for the current request