Pull request for : Test for unintended permissions via API #541

Closes #541