Normally I like seeing stuff like this split out into a method. It's hard when reading code to make a guess at what a four part conditional is attempting to check.

`if user_can_do_something(user, domain)` type lines are a lot easier to understand.