Fix permission check to use correct permissions