def check_membership(self, groups):
if not groups or groups == ['<STR_LIT>']:<EOL><INDENT>return True<EOL><DEDENT>if self.request.user.is_superuser:<EOL><INDENT>return True<EOL><DEDENT>user_groups = self.request.user.groups.values_list("<STR_LIT:name>", flat=True)<EOL>return set(groups).intersection(set(user_groups))<EOL>
Allows for objects with no required groups