summaryrefslogtreecommitdiff
path: root/src/mailman/rest/users.py
diff options
context:
space:
mode:
authorBarry Warsaw2011-08-14 19:14:06 -0400
committerBarry Warsaw2011-08-14 19:14:06 -0400
commit18c48f8660b70bf9c41cd4f24c2112ce719ff455 (patch)
treebc5783937f986f4934557a78e29d161e5296fdd9 /src/mailman/rest/users.py
parent5fd5fd6ca3b2e0b3f7e25c815365f4ebaa0df247 (diff)
downloadmailman-18c48f8660b70bf9c41cd4f24c2112ce719ff455.tar.gz
mailman-18c48f8660b70bf9c41cd4f24c2112ce719ff455.tar.zst
mailman-18c48f8660b70bf9c41cd4f24c2112ce719ff455.zip
* DELETE users via the REST API. (LP: #820660)
Diffstat (limited to '')
-rw-r--r--src/mailman/rest/users.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mailman/rest/users.py b/src/mailman/rest/users.py
index a75b448e7..29a18a45f 100644
--- a/src/mailman/rest/users.py
+++ b/src/mailman/rest/users.py
@@ -32,7 +32,7 @@ from zope.component import getUtility
from mailman.interfaces.address import ExistingAddressError
from mailman.interfaces.usermanager import IUserManager
from mailman.rest.addresses import UserAddresses
-from mailman.rest.helpers import CollectionMixin, etag, path_to
+from mailman.rest.helpers import CollectionMixin, etag, no_content, path_to
from mailman.rest.validator import Validator
from mailman.utilities.passwords import (
encrypt_password, make_user_friendly_password)
@@ -134,3 +134,11 @@ class AUser(_UserBase):
def addresses(self, request, segments):
"""/users/<uid>/addresses"""
return UserAddresses(self._user)
+
+ @resource.DELETE()
+ def delete_user(self, request):
+ """Delete the named user."""
+ if self._user is None:
+ return http.not_found()
+ getUtility(IUserManager).delete_user(self._user)
+ return no_content()