Remove control on restrictions for local content managers
authorThierry Florac <thierry.florac@onf.fr>
Wed, 13 Sep 2017 09:23:25 +0200
changeset 152 363efe154011
parent 151 890d3c1e0c71
child 153 6149158c48c5
Remove control on restrictions for local content managers
src/pyams_content/workflow/notify.py
--- a/src/pyams_content/workflow/notify.py	Tue Sep 12 16:45:45 2017 +0200
+++ b/src/pyams_content/workflow/notify.py	Wed Sep 13 09:23:25 2017 +0200
@@ -68,11 +68,15 @@
                 for role_id in notified_roles:
                     for principal in protection.get_principals(role_id):
                         if role_id == MANAGER_ROLE:
-                            restrictions = IManagerRestrictions(self.context.context, None)
-                            if restrictions is not None:
-                                principal_restrictions = restrictions.get_restrictions(principal)
-                                if principal_restrictions.check_access(context, MANAGE_CONTENT_PERMISSION):
-                                    principals.add(principal)
+                            if principal in self.context.context.managers:
+                                principals.add(principal)
+                            else:
+                                restrictions = IManagerRestrictions(self.context.context, None)
+                                if restrictions is not None:
+                                    principal_restrictions = restrictions.get_restrictions(principal)
+                                    if principal_restrictions.check_access(self.context.context,
+                                                                           MANAGE_CONTENT_PERMISSION):
+                                        principals.add(principal)
                         else:
                             principals.add(principal)
         source_id = self.context.source['id']