Corrected an incorrect permissions check