Fixing has_permission bug in zero_security_mode