REFACTOR: move all conditions to guardian

Refactor code as per @eviltrout's feedback [here](https://github.com/discourse/discourse/commit/4649494e5373#commitcomment-6899432).