Properly handle permissions check