Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting user doesn't have migrate to a user option. #541

Closed
PavtheDog opened this issue Feb 16, 2022 · 1 comment
Closed

Deleting user doesn't have migrate to a user option. #541

PavtheDog opened this issue Feb 16, 2022 · 1 comment
Assignees
Labels
backlog Issue Backlog Tenable.sc Tenable.sc Package upstream-api The issue is related to the calling API or API Docs

Comments

@PavtheDog
Copy link

PavtheDog commented Feb 16, 2022

sc -> users.py -> delete doesn't allow the option to transfer a user's objects to another user. I made the following changes to my code:

 def delete(self, id, migrate_id = None):
        '''
        Removes a user.

        :sc-api:`user: delete <User.html#user_id_DELETE>`

        Args:
            id (int): The numeric identifier for the user to remove.
            migrate_id (int): The numeric identifier for the user to move objects too.

        Returns:
            :obj:`str`:
                An empty response.

        Examples:
            >>> sc.users.delete(1)
        '''
        payload={}
        if not migrate_id is None:
          payload = {'migrateUserID':migrate_id}
        print (payload)
        return self._api.delete('user/{}'.format(
            self._check('id', id, int)), json=payload).json()['response']
@SteveMcGrath
Copy link
Contributor

please feel free to submit a PR.

@SteveMcGrath SteveMcGrath added backlog Issue Backlog Tenable.sc Tenable.sc Package upstream-api The issue is related to the calling API or API Docs labels Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Issue Backlog Tenable.sc Tenable.sc Package upstream-api The issue is related to the calling API or API Docs
Projects
None yet
Development

No branches or pull requests

3 participants