Add support for getting path variables in general middleware. Pass context to getUserRoles from passport middleware.