def validate_fields_only_with_permissions(self, val, caller_permissions):
self.validate_fields_only(val)<EOL>for extra_permission in caller_permissions.permissions:<EOL><INDENT>all_field_names = '<STR_LIT>'.format(extra_permission)<EOL>for field_name in getattr(self.definition, all_field_names, set()):<EOL><INDENT>if not hasattr(val, field_name):<EOL><INDENT>raise ValidationError("<STR_LIT>" % field_name)<EOL><DEDENT><DEDENT><DEDENT>
To pass field validation, no required field should be missing.
This method assumes that the contents of each field have already been
validated on assignment, so it's merely a presence check.
Should only be called for callers with extra permissions.