def add_restriction(self, *usergroups):
if not usergroups:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>allowed = copy.copy(self._raw.get('<STR_LIT>', []))<EOL>for usergroup in usergroups:<EOL><INDENT>if not isinstance(usergroup, UserGroup):<EOL><INDENT>raise TypeError('<STR_LIT>'.format(usergroup))<EOL><DEDENT>selection = usergroup.as_usergroup_selection()<EOL>if selection not in allowed:<EOL><INDENT>allowed.append(selection)<EOL><DEDENT><DEDENT>self._raw['<STR_LIT>'] = allowed<EOL>
Add UserGroup(s) to list of accounts with access to record

        .. versionadded:: 2.16.1

        UserGroups already in the restricted list can be added multiple times and duplicates will be ignored

        Notes:
            Does not take effect until calling `record.save()`

        Args:
            *usergroups (UserGroup): 1 or more Swimlane UserGroup(s) to add to restriction list

        Raises:
            TypeError: If 0 UserGroups provided or provided a non-UserGroup instance