we should iterate through $permission_errors and remove badaccess-groups and badaccess-groups0 entries. Current implementation would ignore all other errors, creating a security hole.