# HG changeset patch # User Thierry Florac # Date 1523544177 -7200 # Node ID 5bd7496f674f39c090e8dd511fa4a011e9e37d1f # Parent 15f595c8c4b005f67e894d90325e9654638c3298 Renamed variables diff -r 15f595c8c4b0 -r 5bd7496f674f src/pyams_content/workflow/notify.py --- a/src/pyams_content/workflow/notify.py Thu Apr 12 16:41:09 2018 +0200 +++ b/src/pyams_content/workflow/notify.py Thu Apr 12 16:42:57 2018 +0200 @@ -61,20 +61,21 @@ notified_roles = self.context.user_data['transition'].user_data['notify_roles'] if '*' in notified_roles: return {} + notification_source = self.context.context principals = set() - for context in lineage(self.context.context): + for context in lineage(notification_source): protection = IProtectedObject(context, None) if protection is not None: for role_id in notified_roles: for principal in protection.get_principals(role_id): if role_id == MANAGER_ROLE: - if principal in self.context.context.managers: + if principal in notification_source.managers: principals.add(principal) else: - restrictions = IManagerRestrictions(self.context.context, None) + restrictions = IManagerRestrictions(notification_source, None) if restrictions is not None: principal_restrictions = restrictions.get_restrictions(principal) - if principal_restrictions.check_access(self.context.context, + if principal_restrictions.check_access(notification_source, MANAGE_CONTENT_PERMISSION): principals.add(principal) else: