~sumanah/mailman/mailman

« back to all changes in this revision

Viewing changes to src/mailman/rest/docs/users.rst

  • Committer: Sumana Harihareswara
  • Date: 2015-04-20 01:29:41 UTC
  • mfrom: (7273.2.59 trunk)
  • Revision ID: sumanah@panix.com-20150420012941-wc4y4fjativpdxj3
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
        created_on: 2005-08-01T07:49:23
35
35
        display_name: Anne Person
36
36
        http_etag: "..."
 
37
        is_server_owner: False
37
38
        self_link: http://localhost:9001/3.0/users/1
38
39
        user_id: 1
39
40
    http_etag: "..."
50
51
        created_on: 2005-08-01T07:49:23
51
52
        display_name: Anne Person
52
53
        http_etag: "..."
 
54
        is_server_owner: False
53
55
        self_link: http://localhost:9001/3.0/users/1
54
56
        user_id: 1
55
57
    entry 1:
56
58
        created_on: 2005-08-01T07:49:23
57
59
        http_etag: "..."
 
60
        is_server_owner: False
58
61
        self_link: http://localhost:9001/3.0/users/2
59
62
        user_id: 2
60
63
    http_etag: "..."
76
79
        created_on: 2005-08-01T07:49:23
77
80
        display_name: Anne Person
78
81
        http_etag: "..."
 
82
        is_server_owner: False
79
83
        self_link: http://localhost:9001/3.0/users/1
80
84
        user_id: 1
81
85
    http_etag: "..."
86
90
    entry 0:
87
91
        created_on: 2005-08-01T07:49:23
88
92
        http_etag: "..."
 
93
        is_server_owner: False
89
94
        self_link: http://localhost:9001/3.0/users/2
90
95
        user_id: 2
91
96
    http_etag: "..."
120
125
    >>> dump_json('http://localhost:9001/3.0/users/3')
121
126
    created_on: 2005-08-01T07:49:23
122
127
    http_etag: "..."
 
128
    is_server_owner: False
123
129
    password: {plaintext}...
124
130
    self_link: http://localhost:9001/3.0/users/3
125
131
    user_id: 3
131
137
    >>> dump_json('http://localhost:9001/3.0/users/cris@example.com')
132
138
    created_on: 2005-08-01T07:49:23
133
139
    http_etag: "..."
 
140
    is_server_owner: False
134
141
    password: {plaintext}...
135
142
    self_link: http://localhost:9001/3.0/users/3
136
143
    user_id: 3
158
165
    created_on: 2005-08-01T07:49:23
159
166
    display_name: Dave Person
160
167
    http_etag: "..."
 
168
    is_server_owner: False
161
169
    password: {plaintext}...
162
170
    self_link: http://localhost:9001/3.0/users/4
163
171
    user_id: 4
190
198
    created_on: 2005-08-01T07:49:23
191
199
    display_name: Elly Person
192
200
    http_etag: "..."
 
201
    is_server_owner: False
193
202
    password: {plaintext}supersekrit
194
203
    self_link: http://localhost:9001/3.0/users/5
195
204
    user_id: 5
214
223
    created_on: 2005-08-01T07:49:23
215
224
    display_name: David Person
216
225
    http_etag: "..."
 
226
    is_server_owner: False
217
227
    password: {plaintext}...
218
228
    self_link: http://localhost:9001/3.0/users/4
219
229
    user_id: 4
238
248
    created_on: 2005-08-01T07:49:23
239
249
    display_name: David Person
240
250
    http_etag: "..."
 
251
    is_server_owner: False
241
252
    password: {plaintext}clockwork angels
242
253
    self_link: http://localhost:9001/3.0/users/4
243
254
    user_id: 4
246
257
resource.
247
258
 
248
259
    >>> dump_json('http://localhost:9001/3.0/users/4', {
 
260
    ...           'cleartext_password': 'the garden',
249
261
    ...           'display_name': 'David Personhood',
250
 
    ...           'cleartext_password': 'the garden',
 
262
    ...           'is_server_owner': False,
251
263
    ...           }, method='PUT')
252
264
    content-length: 0
253
265
    date: ...
260
272
    created_on: 2005-08-01T07:49:23
261
273
    display_name: David Personhood
262
274
    http_etag: "..."
 
275
    is_server_owner: False
263
276
    password: {plaintext}the garden
264
277
    self_link: http://localhost:9001/3.0/users/4
265
278
    user_id: 4
343
356
    created_on: 2005-08-01T07:49:23
344
357
    display_name: Fred Person
345
358
    http_etag: "..."
 
359
    is_server_owner: False
346
360
    self_link: http://localhost:9001/3.0/users/6
347
361
    user_id: 6
348
362
 
350
364
    created_on: 2005-08-01T07:49:23
351
365
    display_name: Fred Person
352
366
    http_etag: "..."
 
367
    is_server_owner: False
353
368
    self_link: http://localhost:9001/3.0/users/6
354
369
    user_id: 6
355
370
 
357
372
    created_on: 2005-08-01T07:49:23
358
373
    display_name: Fred Person
359
374
    http_etag: "..."
 
375
    is_server_owner: False
360
376
    self_link: http://localhost:9001/3.0/users/6
361
377
    user_id: 6
362
378
 
364
380
    created_on: 2005-08-01T07:49:23
365
381
    display_name: Fred Person
366
382
    http_etag: "..."
 
383
    is_server_owner: False
367
384
    self_link: http://localhost:9001/3.0/users/6
368
385
    user_id: 6
369
386
 
382
399
    created_on: 2005-08-01T07:49:23
383
400
    display_name: Elly Person
384
401
    http_etag: "..."
 
402
    is_server_owner: False
385
403
    password: {plaintext}supersekrit
386
404
    self_link: http://localhost:9001/3.0/users/5
387
405
    user_id: 5
399
417
    date: ...
400
418
    server: ...
401
419
    status: 204
 
420
 
 
421
 
 
422
Server owners
 
423
=============
 
424
 
 
425
Users can be designated as server owners.  Elly is not currently a server
 
426
owner.
 
427
 
 
428
    >>> dump_json('http://localhost:9001/3.0/users/5')
 
429
    created_on: 2005-08-01T07:49:23
 
430
    display_name: Elly Person
 
431
    http_etag: "..."
 
432
    is_server_owner: False
 
433
    password: {plaintext}supersekrit
 
434
    self_link: http://localhost:9001/3.0/users/5
 
435
    user_id: 5
 
436
 
 
437
Let's make her a server owner.
 
438
::
 
439
 
 
440
    >>> dump_json('http://localhost:9001/3.0/users/5', {
 
441
    ...           'is_server_owner': True,
 
442
    ...           }, method='PATCH')
 
443
    content-length: 0
 
444
    date: ...
 
445
    server: ...
 
446
    status: 204
 
447
 
 
448
    >>> dump_json('http://localhost:9001/3.0/users/5')
 
449
    created_on: 2005-08-01T07:49:23
 
450
    display_name: Elly Person
 
451
    http_etag: "..."
 
452
    is_server_owner: True
 
453
    password: {plaintext}supersekrit
 
454
    self_link: http://localhost:9001/3.0/users/5
 
455
    user_id: 5
 
456
 
 
457
Elly later retires as server owner.
 
458
::
 
459
 
 
460
    >>> dump_json('http://localhost:9001/3.0/users/5', {
 
461
    ...           'is_server_owner': False,
 
462
    ...           }, method='PATCH')
 
463
    content-length: 0
 
464
    date: ...
 
465
    server: ...
 
466
    status: 204
 
467
 
 
468
    >>> dump_json('http://localhost:9001/3.0/users/5')
 
469
    created_on: 2005-08-01T07:49:23
 
470
    display_name: Elly Person
 
471
    http_etag: "..."
 
472
    is_server_owner: False
 
473
    password: {plaintext}...
 
474
    self_link: http://localhost:9001/3.0/users/5
 
475
    user_id: 5
 
476
 
 
477
Gwen, a new users, takes over as a server owner.
 
478
::
 
479
 
 
480
    >>> dump_json('http://localhost:9001/3.0/users', {
 
481
    ...           'display_name': 'Gwen Person',
 
482
    ...           'email': 'gwen@example.com',
 
483
    ...           'is_server_owner': True,
 
484
    ...           })
 
485
    content-length: 0
 
486
    date: ...
 
487
    location: http://localhost:9001/3.0/users/7
 
488
    server: ...
 
489
    status: 201
 
490
 
 
491
    >>> dump_json('http://localhost:9001/3.0/users/7')
 
492
    created_on: 2005-08-01T07:49:23
 
493
    display_name: Gwen Person
 
494
    http_etag: "..."
 
495
    is_server_owner: True
 
496
    password: {plaintext}...
 
497
    self_link: http://localhost:9001/3.0/users/7
 
498
    user_id: 7