Discussion course production deployment issues fix

Fixed missing `user` context variable in dicussion course + switched to using more efficient `cached_has_permissions`
@antoviaque integration tests are not run against Apros config, and as far as I can tell, `edxmako.middleware.MiddleWare` is enabled in all standard edx-platform configurations.