diff options
| author | Barry Warsaw | 2012-12-25 23:40:50 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2012-12-25 23:40:50 -0500 |
| commit | 5ea7368341cc7faa5ad32355fead44064bf86f2e (patch) | |
| tree | 0fd82a09178cc828eab9e71ece2992115b085903 /src | |
| parent | 9c5a2e27116c95484dd993c4b7ceed64ca9823e4 (diff) | |
| download | mailman-5ea7368341cc7faa5ad32355fead44064bf86f2e.tar.gz mailman-5ea7368341cc7faa5ad32355fead44064bf86f2e.tar.zst mailman-5ea7368341cc7faa5ad32355fead44064bf86f2e.zip | |
Diffstat (limited to 'src')
| -rw-r--r-- | src/mailman/rest/docs/users.rst | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/mailman/rest/docs/users.rst b/src/mailman/rest/docs/users.rst index efd664f27..ca90bf865 100644 --- a/src/mailman/rest/docs/users.rst +++ b/src/mailman/rest/docs/users.rst @@ -3,9 +3,12 @@ Users ===== The REST API can be used to add and remove users, add and remove user -addresses, and change their preferred address, password, or name. Users are -different than members; the latter represents an email address subscribed to a -specific mailing list. Users are just people that Mailman knows about. +addresses, and change their preferred address, password, or name. The API can +also be used to verify a user's password. + +Users are different than members; the latter represents an email address +subscribed to a specific mailing list. Users are just people that Mailman +knows about. There are no users yet. @@ -14,15 +17,18 @@ There are no users yet. start: 0 total_size: 0 -When there are users in the database, they can be retrieved as a collection. -:: +Anne is added, with an email address. Her user record gets a `user_id`. >>> from zope.component import getUtility >>> from mailman.interfaces.usermanager import IUserManager >>> user_manager = getUtility(IUserManager) - >>> anne = user_manager.create_user('anne@example.com', 'Anne Person') >>> transaction.commit() + >>> anne.user_id.int + 1 + +Anne's user record is returned as an entry into the collection of all users. + >>> dump_json('http://localhost:9001/3.0/users') entry 0: created_on: 2005-08-01T07:49:23 @@ -34,12 +40,6 @@ When there are users in the database, they can be retrieved as a collection. start: 0 total_size: 1 -The user ids match. - - >>> json = call_http('http://localhost:9001/3.0/users') - >>> json['entries'][0]['user_id'] == anne.user_id.int - True - A user might not have a display name, in which case, the attribute will not be returned in the REST API. @@ -68,7 +68,6 @@ Creating users via the API New users can be created through the REST API. To do so requires the initial email address for the user, a password, and optionally the user's display name. -:: >>> transaction.abort() >>> dump_json('http://localhost:9001/3.0/users', { |
