WL-3158 Disable roleswap unless published

Roleswap doesn't work for unpublished sites so don't provide the option.
WL-3158 Move logic to helper function
Merge pull request #6 from ox-it/WL-3158

WL-3158 Disable roleswap unless published