def _validate_user(self, user):
<EOL>if self._show_all_users:<EOL><INDENT>return<EOL><DEDENT>if user.id in self._allowed_user_ids:<EOL><INDENT>return<EOL><DEDENT>user_member_group_ids = set([g['<STR_LIT:id>'] for g in user._raw['<STR_LIT>']])<EOL>if user_member_group_ids & self._allowed_member_ids:<EOL><INDENT>return<EOL><DEDENT>raise ValidationError(<EOL>self.record,<EOL>'<STR_LIT>'.format(<EOL>user,<EOL>self.name<EOL>)<EOL>)<EOL>
Validate a User instance against allowed user IDs or membership in a group