~abompard/mailman/subpolicy

« back to all changes in this revision

Viewing changes to src/mailman/interfaces/domain.py

  • Committer: Barry Warsaw
  • Date: 2015-04-07 02:06:28 UTC
  • mfrom: (7313.2.6 lp1423756)
  • mto: This revision was merged to the branch mainline in revision 7323.
  • Revision ID: barry@list.org-20150407020628-fkwphij7to9lc8gy
 * Domains now have a list of owners, which are ``IUser`` objects, instead of
   the single ``contact_address`` they used to have.  ``IUser`` objects now
   also have a ``is_server_owner`` flag (defaulting to False) to indicate
   whether they have superuser privileges.  Give by Abhliash Raj, with fixes
   and refinements by Barry Warsaw.  (LP: #1423756)

 * Domains can now optionally be created with owners; domain owners can be
   added after the fact; domain owners can be deleted.  Also, users now have
   an ``is_server_owner`` flag as part of their representation, which defaults
   to False, and can be PUT and PATCH'd.  Given by Abhilash Raj, with fixes
   and refinements by Barry Warsaw.  (LP: #1423756)

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
    description = Attribute(
89
89
        'The human readable description of the domain name.')
90
90
 
91
 
    contact_address = Attribute("""\
92
 
    The contact address for the human at this domain.
93
 
    E.g. postmaster@example.com""")
 
91
    owners = Attribute("""\
 
92
        The relationship with the user database representing domain owners""")
94
93
 
95
94
    mailing_lists = Attribute(
96
95
        """All mailing lists for this domain.
112
111
class IDomainManager(Interface):
113
112
    """The manager of domains."""
114
113
 
115
 
    def add(mail_host, description=None, base_url=None, contact_address=None):
 
114
    def add(mail_host, description=None, base_url=None, owners=None):
116
115
        """Add a new domain.
117
116
 
118
117
        :param mail_host: The email host name for the domain.
123
122
            interface of the domain.  If not given, it defaults to
124
123
            http://`mail_host`/
125
124
        :type base_url: string
126
 
        :param contact_address: The email contact address for the human
127
 
            managing the domain.  If not given, defaults to
128
 
            postmaster@`mail_host`
129
 
        :type contact_address: string
130
 
        :return: The new domain object
 
125
        :param owners: Sequence of owners of the domain, defaults to None,
 
126
            meaning the domain does not have owners.
 
127
        :type owners: sequence of `IUser` or string emails.
 
128
        :return: The new domain object.
131
129
        :rtype: `IDomain`
132
130
        :raises `BadDomainSpecificationError`: when the `mail_host` is
133
131
            already registered.