products/CPSSubscriptions

changeset 1075:652306aaa0b8 CPS-3.5

#2464: draft implementation
author Georges Racinet on purity.racinet.fr <georges@racinet.fr>
date Mon, 17 Oct 2011 00:03:13 +0200
parents 4fe4f7bbd562
children b72ee2dec53e
files RecipientsRules.py
diffstat 1 files changed, 13 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/RecipientsRules.py
     1.2 +++ b/RecipientsRules.py
     1.3 @@ -79,6 +79,18 @@
     1.4          Note: Group object in CPSUserFolder is presented as a minimal compat
     1.5          layer
     1.6          """
     1.7 +        # pseudo groups special cases
     1.8 +        if group_id == 'role:Authenticated':
     1.9 +            email = acl_users.email_for_authenticated
    1.10 +            if not email:
    1.11 +                raise KeyError(group_id)
    1.12 +        elif group_id == 'role:Anonymous':
    1.13 +            email = acl_users.email_for_anonymous
    1.14 +            if not email:
    1.15 +                raise KeyError(group_id)
    1.16 +        elif group_id.startswith('role:'):
    1.17 +            raise KeyError(group_id)
    1.18 +
    1.19          email_field = acl_users.groups_email_field
    1.20          if not email_field:
    1.21              logger.error("Email field for groups not configured."
    1.22 @@ -857,8 +869,7 @@
    1.23  
    1.24          Takes all little detail, like 'role:' pseudo groups into account.
    1.25          """
    1.26 -
    1.27 -        if group_id.startswith('role:'):
    1.28 +        if group_id.startswith('role:') and expand_groups:
    1.29              return # TODO apply a few mailing lists or what
    1.30  
    1.31          if not expand_groups: