hotfix permission checks when no domain set
Merge pull request #1251 from dimagi/cz

hotfix permission checks when no domain set