diff options
| author | Barry Warsaw | 2015-04-16 15:28:16 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2015-04-16 15:28:16 -0400 |
| commit | 63f0f56219875f1001f8b9eb4572436b46bea30d (patch) | |
| tree | 96f849ebfb0f36998388e31110cc11e243e4903e /src/mailman/rest/docs | |
| parent | 53d4229bff96677a54fd443322c166c2bdcc3054 (diff) | |
| download | mailman-63f0f56219875f1001f8b9eb4572436b46bea30d.tar.gz mailman-63f0f56219875f1001f8b9eb4572436b46bea30d.tar.zst mailman-63f0f56219875f1001f8b9eb4572436b46bea30d.zip | |
Checkpointing.
Diffstat (limited to 'src/mailman/rest/docs')
| -rw-r--r-- | src/mailman/rest/docs/sub-moderation.rst | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/src/mailman/rest/docs/sub-moderation.rst b/src/mailman/rest/docs/sub-moderation.rst new file mode 100644 index 000000000..6d3d4993c --- /dev/null +++ b/src/mailman/rest/docs/sub-moderation.rst @@ -0,0 +1,113 @@ +========================= + Subscription moderation +========================= + +Subscription (and sometimes unsubscription) requests can similarly be +accepted, discarded, rejected, or deferred by the list moderators. + + +Viewing subscription requests +============================= + +A mailing list starts with no pending subscription or unsubscription requests. + + >>> ant = create_list('ant@example.com') + >>> ant.admin_immed_notify = False + >>> from mailman.interfaces.mailinglist import SubscriptionPolicy + >>> ant.subscription_policy = SubscriptionPolicy.moderate + >>> transaction.commit() + >>> dump_json('http://localhost:9001/3.0/lists/ant@example.com/requests') + http_etag: "..." + start: 0 + total_size: 0 + +When Anne tries to subscribe to the Ant list, her subscription is held for +moderator approval. + + >>> from mailman.interfaces.registrar import IRegistrar + >>> from mailman.interfaces.usermanager import IUserManager + >>> from zope.component import getUtility + >>> registrar = IRegistrar(ant) + >>> manager = getUtility(IUserManager) + >>> anne = manager.create_address('anne@example.com', 'Anne Person') + >>> token, token_owner, member = registrar.register( + ... anne, pre_verified=True, pre_confirmed=True) + >>> print(member) + None + +The message is being held for moderator approval. + + >>> token_owner.name + TokenOwner.moderator + +The subscription request can be viewed in the REST API. + + >>> dump_json('http://localhost:9001/3.0/lists/ant@example.com/requests') + entry 0: + delivery_mode: regular + display_name: Anne Person + email: anne@example.com + http_etag: "..." + language: en + request_id: ... + type: subscription + when: 2005-08-01T07:49:23 + http_etag: "..." + start: 0 + total_size: 1 + + +Viewing individual requests +=========================== + +You can view an individual membership change request by providing the token +(a.k.a. request id). Anne's subscription request looks like this. + + >>> dump_json('http://localhost:9001/3.0/lists/ant@example.com/' + ... 'requests/{}'.format(token)) + delivery_mode: regular + display_name: Anne Person + email: anne@example.com + http_etag: "..." + language: en + request_id: ... + type: subscription + when: 2005-08-01T07:49:23 + + +Disposing of subscription requests +================================== + +Moderators can dispose of held subscription requests by POSTing back to the +request's resource. The POST data requires an action of one of the following: + + * discard - throw the request away. + * reject - the request is denied and a notification is sent to the email + address requesting the membership change. + * defer - defer any action on this membership change (continue to hold it). + * accept - accept the membership change. + +Anne's subscription request is accepted. + + >>> dump_json('http://localhost:9001/3.0/lists/' + ... 'ant@example.com/requests/{}'.format(token), + ... {'action': 'accept'}) + content-length: 0 + date: ... + server: ... + status: 204 + +Anne is now a member of the mailing list. + + >>> transaction.abort() + >>> ant.members.get_member('anne@example.com') + <Member: Anne Person <anne@example.com> on ant@example.com + as MemberRole.member> + >>> transaction.abort() + +There are no more membership change requests. + + >>> dump_json('http://localhost:9001/3.0/lists/ant@example.com/requests') + http_etag: "..." + start: 0 + total_size: 0 |
