Skip to content

Commit ed55b70

Browse files
committed
feat(users): add wipe method to UsersAPI
Introduces a new 'wipe' method to disconnect a user from the Nextcloud server and delete all local data stored on the user's devices via the OCS API.
1 parent f6fe6a5 commit ed55b70

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

nc_py_api/users.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ def enable(self, user_id: str) -> None:
206206
def disable(self, user_id: str) -> None:
207207
"""Disables user on the Nextcloud server."""
208208
self._session.ocs("PUT", f"{self._ep_base}/{user_id}/disable")
209+
210+
def wipe(self, user_id: str) -> None:
211+
"""Disconnects user from the Nextcloud server and deletes all local data stored on the user's devices."""
212+
self._session.ocs("POST", f"/ocs/v2.php/cloud/users/{user_id}/wipe")
209213

210214
def resend_welcome_email(self, user_id: str) -> None:
211215
"""Send welcome email for specified user again."""

0 commit comments

Comments
 (0)