Fixed permission check.
Merge branch 'test' into dev