#12808 closed enhancement (fixed)
Allow permission groups to be CC'ed
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.3.6 |
Component: | notification | Version: | |
Severity: | normal | Keywords: | subscriber group |
Cc: | Branch: | ||
Release Notes: |
Permission groups in the CC list are resolved to the users that are members of the group. |
||
API Changes: | |||
Internal Changes: |
Description
Discussed in trac-users:Aly_eHLw7J0/GmzimnwjAAAJ. It would be useful to allow permission groups to be CC'ed, at the very least to improvise until we have a real user and group system in Trac.
-
trac/ticket/notification.py
diff --git a/trac/ticket/notification.py b/trac/ticket/notification.py index 92957d016..589fdbb41 100644
a b from trac.notification.compat import NotifyEmail 29 29 from trac.notification.mail import (RecipientMatcher, create_message_id, 30 30 get_from_author, set_header) 31 31 from trac.notification.model import Subscription 32 from trac.perm import PermissionSystem 32 33 from trac.ticket.api import translation_deactivated 33 34 from trac.ticket.model import Ticket 34 35 from trac.util.datefmt import (datetime_now, format_date_or_datetime, … … class CarbonCopySubscriber(Component): 462 463 if 'fields' in event.changes and 'cc' in event.changes['fields']: 463 464 cc_set.update(to_set(event.changes['fields']['cc']['old'])) 464 465 466 # Get members of permission groups 467 groups = PermissionSystem(self.env).get_groups_dict() 468 for cc in cc_set.copy(): 469 if cc in groups: 470 cc_set.remove(cc) 471 cc_set.update(groups[cc]) 472 465 473 matcher = RecipientMatcher(self.env) 466 474 klass = self.__class__.__name__ 467 475 sids = set()
I don't see much downside to the patch provided that we don't intend to adopt a naming convention for groups later on, which could result in backward incompatible changes.
Attachments (1)
Change History (9)
by , 8 years ago
Attachment: | CarbonCopyGroupSubscriber.py added |
---|
comment:1 by , 8 years ago
comment:2 by , 8 years ago
Milestone: | 1.3.2 → next-dev-1.3.x |
---|
comment:3 by , 5 years ago
Milestone: | next-dev-1.3.x → 1.3.6 |
---|---|
Type: | defect → enhancement |
I'd like to consider this patch for 1.3.6.
comment:4 by , 5 years ago
Status: | assigned → new |
---|
comment:5 by , 5 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:6 by , 5 years ago
Release Notes: | modified (diff) |
---|
Proposed changes in [3b6201f06/rjollos.git].
comment:7 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Committed to trunk in r17046.
CarbonCopyGroupSubscriber.py implements notifications for permission group, for anyone needing an immediate solution. You can make it a default rule:
Please ask on the MailingList, not here, if you have trouble with this single-file plugin.