Updated menus order
authorThierry Florac <tflorac@ulthar.net>
Fri, 13 Nov 2020 13:13:48 +0100
changeset 1429 9b93fdd5ba30
parent 1428 48c1ee485dc0
child 1430 214c52ecca77
Updated menus order
src/pyams_content/component/association/zmi/__init__.py
src/pyams_content/component/extfile/zmi/manager.py
src/pyams_content/component/paragraph/zmi/__init__.py
src/pyams_content/component/paragraph/zmi/container.py
src/pyams_content/features/search/zmi/__init__.py
src/pyams_content/features/search/zmi/manager.py
src/pyams_content/features/search/zmi/reference.py
src/pyams_content/reference/pictograms/zmi/manager.py
src/pyams_content/reference/zmi/table.py
src/pyams_content/shared/blog/zmi/manager.py
src/pyams_content/shared/common/zmi/reference.py
src/pyams_content/shared/common/zmi/types/manager.py
src/pyams_content/shared/form/zmi/field.py
src/pyams_content/shared/imagemap/zmi/container.py
src/pyams_content/shared/resource/zmi/__init__.py
src/pyams_content/shared/site/folder.py
src/pyams_content/shared/site/zmi/__init__.py
src/pyams_content/shared/site/zmi/container.py
src/pyams_content/shared/site/zmi/folder.py
src/pyams_content/shared/site/zmi/link.py
src/pyams_content/shared/view/zmi/reference.py
src/pyams_content/workflow/notify.py
--- a/src/pyams_content/component/association/zmi/__init__.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/component/association/zmi/__init__.py	Fri Nov 13 13:13:48 2020 +0100
@@ -88,7 +88,7 @@
 #
 
 @viewlet_config(name='associations.menu', context=IAssociationContainerTarget, layer=IPyAMSLayer,
-                manager=IPropertiesMenu, permission=VIEW_SYSTEM_PERMISSION, weight=60)
+                manager=IPropertiesMenu, permission=VIEW_SYSTEM_PERMISSION, weight=200)
 class AssociationsMenu(MenuItem):
     """Associations menu"""
 
--- a/src/pyams_content/component/extfile/zmi/manager.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/component/extfile/zmi/manager.py	Fri Nov 13 13:13:48 2020 +0100
@@ -30,7 +30,7 @@
 
 
 @viewlet_config(name='extfiles-manager.menu', context=ISiteRoot, layer=IAdminLayer,
-                manager=IPropertiesMenu, permission=MANAGE_SITE_ROOT_PERMISSION, weight=80)
+                manager=IPropertiesMenu, permission=MANAGE_SITE_ROOT_PERMISSION, weight=770)
 class ExtFileManagerMenu(MenuItem):
     """External files manager menu"""
 
--- a/src/pyams_content/component/paragraph/zmi/__init__.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/component/paragraph/zmi/__init__.py	Fri Nov 13 13:13:48 2020 +0100
@@ -25,6 +25,7 @@
 from pyams_content.features.renderer.zmi.widget import RendererFieldWidget
 from pyams_content.interfaces import MANAGE_CONTENT_PERMISSION, MANAGE_TOOL_PERMISSION
 from pyams_content.shared.common.interfaces import IWfSharedContent
+from pyams_content.shared.site.interfaces import ISiteManager
 from pyams_form.form import AJAXAddForm, AJAXEditForm, ajax_config
 from pyams_form.help import FormHelp
 from pyams_form.interfaces.form import IFormHelp, check_submit_button
@@ -60,7 +61,7 @@
 
 @viewlet_config(name='default-paragraphs.menu', context=IParagraphFactorySettings,
                 layer=IAdminLayer, manager=IPropertiesMenu, permission=MANAGE_TOOL_PERMISSION,
-                weight=10)
+                weight=610)
 class DefaultParagraphsSettingsMenu(MenuItem):
     """Default paragraphs settings menu"""
 
@@ -230,7 +231,7 @@
     """Base paragraph AJAX add form"""
 
     def get_ajax_output(self, changes):
-        if IWfSharedContent.providedBy(self.context):
+        if IWfSharedContent.providedBy(self.context) or ISiteManager.providedBy(self.context):
             table_factory = ParagraphContainerTable
         else:
             table_factory = ParagraphContainerBaseTable
--- a/src/pyams_content/component/paragraph/zmi/container.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/component/paragraph/zmi/container.py	Fri Nov 13 13:13:48 2020 +0100
@@ -10,8 +10,6 @@
 # FOR A PARTICULAR PURPOSE.
 #
 
-__docformat__ = 'restructuredtext'
-
 import json
 
 from pyramid.decorator import reify
@@ -26,10 +24,10 @@
 from pyams_content.component.association.interfaces import IAssociationContainer
 from pyams_content.component.association.zmi import AssociationsContainerView
 from pyams_content.component.paragraph import BaseParagraph, IParagraphTitle
-from pyams_content.component.paragraph.interfaces import IBaseParagraph, IParagraphContainer, IParagraphContainerTarget, \
-    IParagraphFactorySettings
-from pyams_content.component.paragraph.zmi.interfaces import IParagraphContainerTable, IParagraphContainerView, \
-    IParagraphInnerEditor, IParagraphTitleToolbar
+from pyams_content.component.paragraph.interfaces import IBaseParagraph, IParagraphContainer, \
+    IParagraphContainerTarget, IParagraphFactorySettings
+from pyams_content.component.paragraph.zmi.interfaces import IParagraphContainerTable, \
+    IParagraphContainerView, IParagraphInnerEditor, IParagraphTitleToolbar
 from pyams_content.interfaces import MANAGE_CONTENT_PERMISSION
 from pyams_content.shared.common.zmi import WfModifiedContentColumnMixin
 from pyams_content.zmi import pyams_content
@@ -42,8 +40,8 @@
 from pyams_skin.interfaces.container import ITableElementEditor
 from pyams_skin.layer import IPyAMSLayer
 from pyams_skin.page import DefaultPageHeaderAdapter
-from pyams_skin.table import AttributeSwitcherColumn, BaseTable, I18nColumn, ImageColumn, SorterColumn, TrashColumn, \
-    VisibilitySwitcherColumn
+from pyams_skin.table import AttributeSwitcherColumn, BaseTable, I18nColumn, ImageColumn, \
+    SorterColumn, TrashColumn, VisibilitySwitcherColumn
 from pyams_skin.viewlet.menu import MenuItem
 from pyams_template.template import template_config
 from pyams_utils.adapter import ContextRequestViewAdapter, NullAdapter, adapter_config
@@ -51,7 +49,8 @@
 from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION
 from pyams_utils.traversing import get_parent
 from pyams_utils.url import absolute_url
-from pyams_viewlet.manager import TemplateBasedViewletManager, WeightOrderedViewletManager, viewletmanager_config
+from pyams_viewlet.manager import TemplateBasedViewletManager, WeightOrderedViewletManager, \
+    viewletmanager_config
 from pyams_viewlet.viewlet import Viewlet, viewlet_config
 from pyams_zmi.form import AdminDialogDisplayForm
 from pyams_zmi.interfaces.menu import IPropertiesMenu
@@ -59,11 +58,14 @@
 from pyams_zmi.view import AdminView, ContainerAdminView
 from pyams_zmi.zmi.table import InnerTableView
 
+
+__docformat__ = 'restructuredtext'
+
 from pyams_content import _
 
 
 @viewlet_config(name='paragraphs.menu', context=IParagraphContainerTarget, layer=IAdminLayer,
-                manager=IPropertiesMenu, permission=VIEW_SYSTEM_PERMISSION, weight=50)
+                manager=IPropertiesMenu, permission=VIEW_SYSTEM_PERMISSION, weight=100)
 class ParagraphsContainerMenu(MenuItem):
     """Paragraphs container menu"""
 
@@ -405,7 +407,7 @@
 #
 
 @viewlet_config(name='paragraphs-associations.menu', context=IParagraphContainerTarget, layer=IAdminLayer,
-                manager=IPropertiesMenu, permission=VIEW_SYSTEM_PERMISSION, weight=60)
+                manager=IPropertiesMenu, permission=VIEW_SYSTEM_PERMISSION, weight=110)
 class ParagraphsAssociationsMenu(MenuItem):
     """Paragraphs associations container menu"""
 
--- a/src/pyams_content/features/search/zmi/__init__.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/features/search/zmi/__init__.py	Fri Nov 13 13:13:48 2020 +0100
@@ -10,20 +10,19 @@
 # FOR A PARTICULAR PURPOSE.
 #
 
-__docformat__ = 'restructuredtext'
-
 from z3c.form import field
 from zope.interface import Interface
 from zope.intid import IIntIds
 
 from pyams_content.features.search import ISearchFolder, SearchFolder
 from pyams_content.interfaces import MANAGE_SITE_PERMISSION
-from pyams_content.shared.common.zmi.summary import SharedContentDublinCoreSummary, SharedContentWorkflowHistorySummary, \
-    SharedContentWorkflowPublicationState
+from pyams_content.shared.common.zmi.summary import SharedContentDublinCoreSummary, \
+    SharedContentWorkflowHistorySummary, SharedContentWorkflowPublicationState
 from pyams_content.shared.site.interfaces import ISiteContainer
 from pyams_content.shared.site.zmi import SiteManagerFoldersSelectorFieldWidget
 from pyams_content.shared.site.zmi.container import SiteContainerHeaderContentProvider
 from pyams_content.shared.site.zmi.folder import ISiteFolderAddFormFields
+from pyams_content.zmi.interfaces import ISiteTreeTable
 from pyams_form.form import AJAXAddForm, ajax_config
 from pyams_form.interfaces.form import IInnerSubForm
 from pyams_i18n.interfaces import II18n, INegotiator
@@ -34,7 +33,8 @@
 from pyams_skin.layer import IPyAMSLayer
 from pyams_skin.viewlet.menu import MenuDivider
 from pyams_skin.viewlet.toolbar import ToolbarMenuItem
-from pyams_utils.adapter import ContextRequestAdapter, ContextRequestViewAdapter, NullAdapter, adapter_config
+from pyams_utils.adapter import ContextRequestAdapter, ContextRequestViewAdapter, NullAdapter, \
+    adapter_config
 from pyams_utils.registry import get_utility
 from pyams_utils.unicode import translate_string
 from pyams_utils.url import absolute_url
@@ -44,6 +44,9 @@
 from pyams_zmi.interfaces.menu import IContentManagementMenu
 from pyams_zmi.layer import IAdminLayer
 
+
+__docformat__ = 'restructuredtext'
+
 from pyams_content import _
 
 
@@ -70,14 +73,16 @@
             title=II18n(self.context).query_attribute('title', request=self.request))
 
 
-@viewlet_config(name='add-search-folder.divider', context=ISiteContainer, layer=IAdminLayer, view=Interface,
-                manager=IToolbarAddingMenu, permission=MANAGE_SITE_PERMISSION, weight=89)
+@viewlet_config(name='add-search-folder.divider', context=ISiteContainer, layer=IAdminLayer,
+                view=ISiteTreeTable, manager=IToolbarAddingMenu,
+                permission=MANAGE_SITE_PERMISSION, weight=89)
 class SearchFolderAddMenuDivider(MenuDivider):
     """Search folder add menu divider"""
 
 
-@viewlet_config(name='add-search-folder.menu', context=ISiteContainer, layer=IAdminLayer, view=Interface,
-                manager=IToolbarAddingMenu, permission=MANAGE_SITE_PERMISSION, weight=90)
+@viewlet_config(name='add-search-folder.menu', context=ISiteContainer, layer=IAdminLayer,
+                view=ISiteTreeTable, manager=IToolbarAddingMenu,
+                permission=MANAGE_SITE_PERMISSION, weight=90)
 class SearchFolderAddMenu(ToolbarMenuItem):
     """Search folder add menu"""
 
--- a/src/pyams_content/features/search/zmi/manager.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/features/search/zmi/manager.py	Fri Nov 13 13:13:48 2020 +0100
@@ -32,13 +32,13 @@
 
 
 @viewlet_config(name='search.divider', context=ISiteRoot, layer=IAdminLayer,
-                manager=IPropertiesMenu, permission=MANAGE_SITE_ROOT_PERMISSION, weight=34)
+                manager=IPropertiesMenu, permission=MANAGE_SITE_ROOT_PERMISSION, weight=699)
 class SearchManagerMenuDivider(MenuDivider):
     """Search manager menu divider"""
 
 
 @viewlet_config(name='search-manager.menu', context=ISiteRoot, layer=IAdminLayer,
-                manager=IPropertiesMenu, permission=MANAGE_SITE_ROOT_PERMISSION, weight=35)
+                manager=IPropertiesMenu, permission=MANAGE_SITE_ROOT_PERMISSION, weight=700)
 class SearchManagerMenu(MenuItem):
     """Search manager menu"""
 
--- a/src/pyams_content/features/search/zmi/reference.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/features/search/zmi/reference.py	Fri Nov 13 13:13:48 2020 +0100
@@ -24,12 +24,14 @@
 
 
 @viewlet_config(name='references.menu', context=ISearchFolder, layer=IAdminLayer,
-                manager=IPropertiesMenu, permission=VIEW_SYSTEM_PERMISSION, weight=290)
+                manager=IPropertiesMenu)
 class SearchFolderReferencesMenu(NullAdapter):
     """Disabled search folder references menu"""
 
 
-@pagelet_config(name='references.html', context=ISearchFolder, layer=IPyAMSLayer, permission=FORBIDDEN_PERMISSION)
-@ajax_config(name='references.json', context=ISearchFolder, layer=IPyAMSLayer, permission=FORBIDDEN_PERMISSION)
+@pagelet_config(name='references.html', context=ISearchFolder, layer=IPyAMSLayer,
+                permission=FORBIDDEN_PERMISSION)
+@ajax_config(name='references.json', context=ISearchFolder, layer=IPyAMSLayer,
+             permission=FORBIDDEN_PERMISSION)
 class SearchFolderReferencesEditForm(NullAdapter):
     """Disabled search folder references settings edit form"""
--- a/src/pyams_content/reference/pictograms/zmi/manager.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/reference/pictograms/zmi/manager.py	Fri Nov 13 13:13:48 2020 +0100
@@ -41,7 +41,7 @@
 
 
 @viewlet_config(name='pictograms-selection.menu', context=IPictogramManagerTarget, layer=IAdminLayer,
-                manager=IPropertiesMenu, permission=MANAGE_TOOL_PERMISSION, weight=50)
+                manager=IPropertiesMenu, permission=MANAGE_TOOL_PERMISSION, weight=760)
 class PictogramManagerMenu(MenuItem):
     """Pictogram manager menu"""
 
--- a/src/pyams_content/reference/zmi/table.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/reference/zmi/table.py	Fri Nov 13 13:13:48 2020 +0100
@@ -136,7 +136,7 @@
 
 
 @viewlet_config(name='properties.menu', context=IReferenceTable, layer=IAdminLayer,
-                manager=IPropertiesMenu, permission=VIEW_SYSTEM_PERMISSION, weight=20)
+                manager=IPropertiesMenu, permission=VIEW_SYSTEM_PERMISSION, weight=10)
 class ReferenceTablePropertiesMenu(MenuItem):
     """Reference table properties menu"""
 
--- a/src/pyams_content/shared/blog/zmi/manager.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/shared/blog/zmi/manager.py	Fri Nov 13 13:13:48 2020 +0100
@@ -174,9 +174,9 @@
 # Blog manager publication views
 #
 
-@viewlet_config(name='workflow-publication.menu', context=IBlogManager, layer=IPyAMSLayer,
+@viewlet_config(name='workflow-publication.menu', context=IBlogManager, layer=IAdminLayer,
                 view=ISiteTreeTable, manager=ITableItemColumnActionsMenu,
-                permission=MANAGE_SITE_PERMISSION, weight=210)
+                permission=MANAGE_SITE_PERMISSION, weight=510)
 class BlogManagerTableItemWorkflowPublicationMenu(ToolbarMenuItem):
     """Blog manager tree item workflow publication menu"""
 
@@ -188,7 +188,7 @@
 
 
 @viewlet_config(name='workflow-publication.menu', context=IBlogManager, layer=IAdminLayer,
-                manager=IPropertiesMenu, permission=MANAGE_SITE_PERMISSION, weight=210)
+                manager=IPropertiesMenu, permission=MANAGE_SITE_PERMISSION, weight=510)
 class BlogManagerWorkflowPublicationMenu(MenuItem):
     """Blog manager workflow publication menu"""
 
--- a/src/pyams_content/shared/common/zmi/reference.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/shared/common/zmi/reference.py	Fri Nov 13 13:13:48 2020 +0100
@@ -35,7 +35,7 @@
 
 
 @viewlet_config(name='references.menu', context=IInternalReferencesList, layer=IAdminLayer,
-                manager=IPropertiesMenu, permission=VIEW_SYSTEM_PERMISSION, weight=80)
+                manager=IPropertiesMenu, permission=VIEW_SYSTEM_PERMISSION, weight=300)
 class ReferencesMenu(MenuItem):
     """Internal references menu"""
 
--- a/src/pyams_content/shared/common/zmi/types/manager.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/shared/common/zmi/types/manager.py	Fri Nov 13 13:13:48 2020 +0100
@@ -26,7 +26,7 @@
 from pyams_skin.container import delete_container_element
 from pyams_skin.layer import IPyAMSLayer
 from pyams_skin.table import ActionColumn, BaseTable, NameColumn, SorterColumn, TrashColumn
-from pyams_skin.viewlet.menu import MenuItem
+from pyams_skin.viewlet.menu import MenuDivider, MenuItem
 from pyams_utils.adapter import ContextRequestViewAdapter, adapter_config
 from pyams_utils.fanstatic import get_resource_path
 from pyams_utils.url import absolute_url
@@ -38,8 +38,14 @@
 from pyams_content import _
 
 
+@viewlet_config(name='data-types.divider', context=ITypedSharedTool, layer=IAdminLayer,
+                manager=IPropertiesMenu, permission=MANAGE_TOOL_PERMISSION, weight=599)
+class TypedSharedToolTyesMenuDivider(MenuDivider):
+    """Typed shared tool types menu divider"""
+
+
 @viewlet_config(name='data-types.menu', context=ITypedSharedTool, layer=IAdminLayer,
-                manager=IPropertiesMenu, permission=MANAGE_TOOL_PERMISSION, weight=5)
+                manager=IPropertiesMenu, permission=MANAGE_TOOL_PERMISSION, weight=600)
 class TypedSharedToolTypesMenu(MenuItem):
     """Typed shared tool types menu"""
 
--- a/src/pyams_content/shared/form/zmi/field.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/shared/form/zmi/field.py	Fri Nov 13 13:13:48 2020 +0100
@@ -61,7 +61,7 @@
 
 
 @viewlet_config(name='form-fields.menu', context=IFormFieldContainerTarget, layer=IAdminLayer,
-                manager=IPropertiesMenu, permission=VIEW_SYSTEM_PERMISSION, weight=20)
+                manager=IPropertiesMenu, permission=VIEW_SYSTEM_PERMISSION, weight=120)
 class FormFieldsMenu(MenuItem):
     """Form fields menu"""
 
--- a/src/pyams_content/shared/imagemap/zmi/container.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/shared/imagemap/zmi/container.py	Fri Nov 13 13:13:48 2020 +0100
@@ -47,7 +47,7 @@
 
 
 @viewlet_config(name='areas.submenu', context=IWfImageMap, layer=IAdminLayer,
-                manager=IPropertiesMenu, permission=MANAGE_CONTENT_PERMISSION, weight=80)
+                manager=IPropertiesMenu, permission=MANAGE_CONTENT_PERMISSION, weight=210)
 class ImagemapAreasMenu(MenuItem):
     """Image map areas menu"""
 
--- a/src/pyams_content/shared/resource/zmi/__init__.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/shared/resource/zmi/__init__.py	Fri Nov 13 13:13:48 2020 +0100
@@ -79,7 +79,7 @@
 #
 
 @viewlet_config(name='custom-properties.menu', context=IWfResource, layer=IPyAMSLayer,
-                manager=IPropertiesMenu, permission=MANAGE_CONTENT_PERMISSION, weight=15)
+                manager=IPropertiesMenu, permission=MANAGE_CONTENT_PERMISSION, weight=20)
 class ResourceTypePropertiesMenu(MenuItem):
     """Resource type properties menu"""
 
--- a/src/pyams_content/shared/site/folder.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/shared/site/folder.py	Fri Nov 13 13:13:48 2020 +0100
@@ -18,6 +18,7 @@
 from zope.schema.fieldproperty import FieldProperty
 from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary
 
+from pyams_content import _
 from pyams_content.component.illustration import IIllustrationTarget, ILinkIllustrationTarget
 from pyams_content.component.links import InternalLink
 from pyams_content.features.menu import IDynamicMenu
@@ -38,8 +39,6 @@
 from pyams_utils.traversing import get_parent
 from pyams_utils.vocabulary import vocabulary_config
 
-from pyams_content import _
-
 
 @implementer(IDefaultProtectionPolicy, ISiteFolder, ISiteFolderRoles,
              IIllustrationTarget, ILinkIllustrationTarget, IPortalContext, IPreviewTarget)
@@ -98,5 +97,6 @@
                 intids = registry.getUtility(IIntIds)
                 for folder in find_objects_providing(site, ISiteFolder):
                     terms.append(SimpleTerm(value=intids.queryId(folder),
-                                            title=II18n(folder).query_attribute('title', request=request)))
+                                            title=II18n(folder).query_attribute('title',
+                                                                                request=request)))
         super(SiteManagerFoldersVocabulary, self).__init__(terms)
--- a/src/pyams_content/shared/site/zmi/__init__.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/shared/site/zmi/__init__.py	Fri Nov 13 13:13:48 2020 +0100
@@ -15,7 +15,6 @@
 from pyramid.decorator import reify
 from pyramid.path import DottedNameResolver
 from z3c.form import field
-from zope.interface import Interface
 from zope.intid.interfaces import IIntIds
 from zope.lifecycleevent import ObjectCreatedEvent
 from zope.schema import Int
@@ -26,6 +25,7 @@
 from pyams_content.shared.site import IWfSiteTopic
 from pyams_content.shared.site.interfaces import ISiteContainer, ISiteManager
 from pyams_content.shared.site.zmi.widget import SiteManagerFoldersSelectorFieldWidget
+from pyams_content.zmi.interfaces import ISiteTreeTable
 from pyams_form.form import ajax_config
 from pyams_i18n.interfaces import II18nManager, INegotiator
 from pyams_pagelet.pagelet import pagelet_config
@@ -45,8 +45,9 @@
 from pyams_content import _
 
 
-@viewlet_config(name='add-topic.menu', context=ISiteContainer, layer=IAdminLayer, view=Interface,
-                manager=IToolbarAddingMenu, permission=CREATE_CONTENT_PERMISSION, weight=20)
+@viewlet_config(name='add-topic.menu', context=ISiteContainer, layer=IAdminLayer,
+                view=ISiteTreeTable, manager=IToolbarAddingMenu,
+                permission=CREATE_CONTENT_PERMISSION, weight=20)
 class TopicAddMenu(ToolbarMenuItem):
     """Topic add menu"""
 
--- a/src/pyams_content/shared/site/zmi/container.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/shared/site/zmi/container.py	Fri Nov 13 13:13:48 2020 +0100
@@ -72,8 +72,10 @@
 from pyams_content import _
 
 
-@contentprovider_config(name='content_header', context=ISharedSite, view=Interface, layer=IPyAMSLayer)
-@contentprovider_config(name='content_header', context=ISiteContainer, view=Interface, layer=IPyAMSLayer)
+@contentprovider_config(name='content_header', context=ISharedSite,
+                        view=Interface, layer=IPyAMSLayer)
+@contentprovider_config(name='content_header', context=ISiteContainer,
+                        view=Interface, layer=IPyAMSLayer)
 @template_config(template='templates/container-header.pt', layer=IPyAMSLayer)
 class SiteContainerHeaderContentProvider(object):
     """Site container header content provider"""
@@ -145,8 +147,9 @@
 # Site container publication views
 #
 
-@viewlet_config(name='workflow-publication.menu', context=IBaseSiteItem, layer=IPyAMSLayer, view=ISiteTreeTable,
-                manager=ITableItemColumnActionsMenu, permission=MANAGE_SITE_PERMISSION, weight=210)
+@viewlet_config(name='workflow-publication.menu', context=IBaseSiteItem, layer=IPyAMSLayer,
+                view=ISiteTreeTable, manager=ITableItemColumnActionsMenu,
+                permission=MANAGE_SITE_PERMISSION, weight=810)
 class SiteContainerTableItemWorkflowPublicationMenu(ToolbarMenuItem):
     """Site container tree item workflow publication menu"""
 
@@ -157,8 +160,8 @@
     stop_propagation = True
 
 
-@viewlet_config(name='workflow-publication.menu', context=IBaseSiteItem, layer=IAdminLayer, manager=IPropertiesMenu,
-                permission=MANAGE_SITE_PERMISSION, weight=210)
+@viewlet_config(name='workflow-publication.menu', context=IBaseSiteItem, layer=IAdminLayer,
+                manager=IPropertiesMenu, permission=MANAGE_SITE_PERMISSION, weight=510)
 class SiteContainerWorkflowPublicationMenu(MenuItem):
     """Site container workflow publication menu"""
 
@@ -178,7 +181,8 @@
 
     legend = _("Update publication dates")
 
-    fields = field.Fields(IWorkflowPublicationInfo).select('publication_effective_date', 'publication_expiration_date')
+    fields = field.Fields(IWorkflowPublicationInfo).select('publication_effective_date',
+                                                           'publication_expiration_date')
     edit_permission = MANAGE_SITE_PERMISSION
 
     def updateWidgets(self, prefix=None):
@@ -215,9 +219,10 @@
 # Site container tree view
 #
 
-@viewlet_config(name='site-tree.menu', layer=IAdminLayer, context=IBaseSiteItem, manager=ISiteManagementMenu,
-                permission=VIEW_SYSTEM_PERMISSION, weight=10)
-@viewletmanager_config(name='site-tree.menu', layer=IAdminLayer, context=IBaseSiteItem, provides=ISiteTreeMenu)
+@viewlet_config(name='site-tree.menu', layer=IAdminLayer, context=IBaseSiteItem,
+                manager=ISiteManagementMenu, permission=VIEW_SYSTEM_PERMISSION, weight=10)
+@viewletmanager_config(name='site-tree.menu', layer=IAdminLayer, context=IBaseSiteItem,
+                       provides=ISiteTreeMenu)
 @implementer(ISiteTreeMenu)
 class SiteContainerTreeMenu(MenuItem):
     """Site container tree menu"""
@@ -248,7 +253,8 @@
     def cssClasses(self):
         classes = ['table', 'table-bordered', 'table-striped', 'table-hover', 'table-tight']
         permission = self.permission
-        if self.can_sort and ((not permission) or self.request.has_permission(permission, self.context)):
+        if self.can_sort and ((not permission) or self.request.has_permission(permission,
+                                                                              self.context)):
             classes.append('table-dnd')
         return {
             'table': ' '.join(classes),
@@ -280,7 +286,9 @@
         return attributes
 
 
-@adapter_config(name='sorter', context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable), provides=IColumn)
+@adapter_config(name='sorter',
+                context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable),
+                provides=IColumn)
 class SiteContainerTreeSorterColumn(SorterColumn):
     """Site container tree sorter column"""
 
@@ -346,7 +354,9 @@
     return result
 
 
-@adapter_config(name='visible', context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable), provides=IColumn)
+@adapter_config(name='visible',
+                context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable),
+                provides=IColumn)
 class SiteContainerTreeVisibleColumn(JsActionColumn):
     """Site container tree visible column"""
 
@@ -386,20 +396,23 @@
 
     def get_icon_hint(self, item):
         translate = self.request.localizer.translate
-        if ISiteLink.providedBy(item) and self.request.has_permission(self.permission, context=item):
+        if ISiteLink.providedBy(item) and self.request.has_permission(self.permission,
+                                                                      context=item):
             return translate(self.active_icon_hint)
         else:
             return translate(self.inactive_icon_hint)
 
     def renderCell(self, item):
-        if ISiteLink.providedBy(item) and self.request.has_permission(self.permission, context=item):
+        if ISiteLink.providedBy(item) and self.request.has_permission(self.permission,
+                                                                      context=item):
             return super(SiteContainerTreeVisibleColumn, self).renderCell(item)
         else:
             return self.get_icon(item)
 
 
-@view_config(name='switch-content-visibility.json', context=IBaseSiteItem, request_type=IPyAMSLayer,
-             permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True)
+@view_config(name='switch-content-visibility.json', context=IBaseSiteItem,
+             request_type=IPyAMSLayer, permission=MANAGE_CONTENT_PERMISSION,
+             renderer='json', xhr=True)
 def switch_content_visibility(request):
     """Switch content link visibility"""
     container = ISiteContainer(request.context)
@@ -413,12 +426,16 @@
     }
 
 
-@adapter_config(name='type', context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable), provides=IColumn)
+@adapter_config(name='type',
+                context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable),
+                provides=IColumn)
 class SiteContainerTreeTypeColumn(NullAdapter):
     """Site container tree type column -- disabled in site tree view!"""
 
 
-@adapter_config(name='name', context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable), provides=IColumn)
+@adapter_config(name='name',
+                context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable),
+                provides=IColumn)
 class SiteContainerTreeNameColumn(NameColumn):
     """Site container tree name column"""
 
@@ -454,7 +471,8 @@
                 title=name or super(SiteContainerTreeNameColumn, self).renderCell(item))
 
 
-@adapter_config(name='content-type', context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable),
+@adapter_config(name='content-type',
+                context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable),
                 provides=IColumn)
 class SiteContainerContentTypeColumn(I18nColumn, GetAttrColumn):
     """Site container content type column"""
@@ -467,7 +485,8 @@
         return self.request.localizer.translate(obj.content_name)
 
 
-@adapter_config(name='sequence', context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable),
+@adapter_config(name='sequence',
+                context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable),
                 provides=IColumn)
 class SiteContainerTreeSequenceColumn(SharedToolDashboardSequenceColumn):
     """Site container tree OID column"""
@@ -482,7 +501,9 @@
         return result
 
 
-@adapter_config(name='status', context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable), provides=IColumn)
+@adapter_config(name='status',
+                context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable),
+                provides=IColumn)
 class SiteContainerTreeStatusColumn(SharedToolDashboardStatusColumn):
     """Site container tree status column"""
 
@@ -496,7 +517,9 @@
         return result
 
 
-@adapter_config(name='status_date', context=(IBaseSiteItem, IPyAMSLayer, IDashboardTable), provides=IColumn)
+@adapter_config(name='status_date',
+                context=(IBaseSiteItem, IPyAMSLayer, IDashboardTable),
+                provides=IColumn)
 class SiteContainerTreeStatusDateColumn(SharedToolDashboardStatusDateColumn):
     """Site container tree status date column"""
 
@@ -510,7 +533,9 @@
         return result
 
 
-@adapter_config(name='version', context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable), provides=IColumn)
+@adapter_config(name='version',
+                context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable),
+                provides=IColumn)
 class SiteContainerTreeVersionColumn(SharedToolDashboardVersionColumn):
     """Site container tree version column"""
 
@@ -524,7 +549,9 @@
         return result
 
 
-@adapter_config(name='status_principal', context=(IBaseSiteItem, IPyAMSLayer, IDashboardTable), provides=IColumn)
+@adapter_config(name='status_principal',
+                context=(IBaseSiteItem, IPyAMSLayer, IDashboardTable),
+                provides=IColumn)
 class SiteContainerTreeStatusPrincipalColumn(SharedToolDashboardStatusPrincipalColumn):
     """Site container tree status principal column"""
 
@@ -538,7 +565,9 @@
         return result
 
 
-@adapter_config(name='owner', context=(IBaseSiteItem, IPyAMSLayer, IDashboardTable), provides=IColumn)
+@adapter_config(name='owner',
+                context=(IBaseSiteItem, IPyAMSLayer, IDashboardTable),
+                provides=IColumn)
 class SiteContainerTreeOwnerColumn(SharedToolDashboardOwnerColumn):
     """Site container tree owner column"""
 
@@ -552,7 +581,9 @@
         return result
 
 
-@adapter_config(name='trash', context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable), provides=IColumn)
+@adapter_config(name='trash',
+                context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable),
+                provides=IColumn)
 class SiteContainerTreeTrashColumn(TrashColumn):
     """Site container tree trash column"""
 
@@ -572,7 +603,8 @@
     return delete_container_element(request, ignore_permission=True)
 
 
-@adapter_config(context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable), provides=IValues)
+@adapter_config(context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable),
+                provides=IValues)
 class SiteContainerTreeValuesAdapter(ContextRequestViewAdapter):
     """Site container tree values adapter"""
 
@@ -596,7 +628,8 @@
         return values
 
 
-@pagelet_config(name='site-tree.html', context=IBaseSiteItem, layer=IPyAMSLayer, permission=VIEW_SYSTEM_PERMISSION)
+@pagelet_config(name='site-tree.html', context=IBaseSiteItem, layer=IPyAMSLayer,
+                permission=VIEW_SYSTEM_PERMISSION)
 @implementer(IInnerPage)
 class SiteContainerTreeView(AdminView, ContainerView):
     """Site Container tree view"""
@@ -605,10 +638,12 @@
 
     def __init__(self, context, request):
         super(ContainerView, self).__init__(context, request)
-        self.table = SiteContainerTreeTable(context, request, can_sort=ISiteManager.providedBy(context))
+        self.table = SiteContainerTreeTable(context, request,
+                                            can_sort=ISiteManager.providedBy(context))
 
 
-@adapter_config(context=(IBaseSiteItem, IAdminLayer, ISiteTreeTable), provides=IPageHeader)
+@adapter_config(context=(IBaseSiteItem, IAdminLayer, ISiteTreeTable),
+                provides=IPageHeader)
 class SiteContainerViewHeaderAdapter(DefaultPageHeaderAdapter):
     """Site container tree view header adapter"""
 
@@ -652,7 +687,8 @@
     return result
 
 
-@adapter_config(context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable), provides=ITableElementName)
+@adapter_config(context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable),
+                provides=ITableElementName)
 class SiteContainerTableElementName(ContextRequestViewAdapter):
     """Site container tree table element name"""
 
@@ -661,7 +697,8 @@
         return II18n(self.context).query_attribute('title', request=self.request)
 
 
-@adapter_config(context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable), provides=ITableElementEditor)
+@adapter_config(context=(IBaseSiteItem, IPyAMSLayer, ISiteTreeTable),
+                provides=ITableElementEditor)
 class SiteContainerTableElementEditor(DefaultElementEditorAdapter):
     """Site container tree table element editor"""
 
@@ -669,7 +706,8 @@
     modal_target = False
 
 
-@adapter_config(context=(ISharedContent, IPyAMSLayer, ISiteTreeTable), provides=ITableElementName)
+@adapter_config(context=(ISharedContent, IPyAMSLayer, ISiteTreeTable),
+                provides=ITableElementName)
 class SharedContentTableElementName(ContextRequestViewAdapter):
     """Shared content tree table element name"""
 
@@ -679,7 +717,8 @@
         return II18n(version).query_attribute('title', request=self.request)
 
 
-@adapter_config(context=(ISharedContent, IPyAMSLayer, ISiteTreeTable), provides=ITableElementEditor)
+@adapter_config(context=(ISharedContent, IPyAMSLayer, ISiteTreeTable),
+                provides=ITableElementEditor)
 class SharedContentTableElementEditor(DefaultElementEditorAdapter):
     """Shared content tree table element editor"""
 
--- a/src/pyams_content/shared/site/zmi/folder.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/shared/site/zmi/folder.py	Fri Nov 13 13:13:48 2020 +0100
@@ -10,8 +10,6 @@
 # FOR A PARTICULAR PURPOSE.
 #
 
-__docformat__ = 'restructuredtext'
-
 from pyramid.events import subscriber
 from pyramid.path import DottedNameResolver
 from z3c.form import field
@@ -27,6 +25,7 @@
 from pyams_content.shared.common.zmi.manager import SharedToolPropertiesEditForm
 from pyams_content.shared.site.interfaces import ISiteContainer, ISiteFolder, ISiteManager
 from pyams_content.shared.site.zmi.widget import SiteManagerFoldersSelectorFieldWidget
+from pyams_content.zmi.interfaces import ISiteTreeTable
 from pyams_form.form import AJAXAddForm, ajax_config
 from pyams_form.group import NamedWidgetsGroup
 from pyams_form.interfaces.form import IInnerSubForm
@@ -48,11 +47,15 @@
 from pyams_zmi.interfaces.menu import ISiteManagementMenu
 from pyams_zmi.layer import IAdminLayer
 
+
+__docformat__ = 'restructuredtext'
+
 from pyams_content import _
 
 
-@viewlet_config(name='add-site-folder.menu', context=ISiteContainer, layer=IAdminLayer, view=Interface,
-                manager=IToolbarAddingMenu, permission=MANAGE_SITE_PERMISSION, weight=10)
+@viewlet_config(name='add-site-folder.menu', context=ISiteContainer, layer=IAdminLayer,
+                view=ISiteTreeTable, manager=IToolbarAddingMenu,
+                permission=MANAGE_SITE_PERMISSION, weight=10)
 class SiteFolderAddMenu(ToolbarMenuItem):
     """Site folder add menu"""
 
--- a/src/pyams_content/shared/site/zmi/link.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/shared/site/zmi/link.py	Fri Nov 13 13:13:48 2020 +0100
@@ -10,18 +10,21 @@
 # FOR A PARTICULAR PURPOSE.
 #
 
+from pyams_content import _
+
 __docformat__ = 'restructuredtext'
 
 from uuid import uuid4
 
 from z3c.form import field
 from z3c.form.browser.checkbox import SingleCheckBoxFieldWidget
-from zope.interface import Interface, implementer
+from zope.interface import implementer
 from zope.intid.interfaces import IIntIds
 from zope.schema import Int
 
 from pyams_content.interfaces import CREATE_CONTENT_PERMISSION, MANAGE_CONTENT_PERMISSION
-from pyams_content.shared.site.interfaces import IContentLink, IExternalContentLink, ISiteContainer
+from pyams_content.shared.site.interfaces import IContentLink, IExternalContentLink, \
+    ISiteContainer
 from pyams_content.shared.site.link import ContentLink, ExternalContentLink
 from pyams_content.shared.site.zmi.container import SiteContainerTreeTable
 from pyams_content.shared.site.zmi.widget import SiteManagerFoldersSelectorFieldWidget
@@ -45,11 +48,10 @@
 from pyams_zmi.interfaces import IPropertiesEditForm
 from pyams_zmi.layer import IAdminLayer
 
-from pyams_content import _
 
-
-@viewlet_config(name='add-link.divider', context=ISiteContainer, layer=IAdminLayer, view=Interface,
-                manager=IToolbarAddingMenu, permission=CREATE_CONTENT_PERMISSION, weight=49)
+@viewlet_config(name='add-link.divider', context=ISiteContainer, layer=IAdminLayer,
+                view=ISiteTreeTable, manager=IToolbarAddingMenu,
+                permission=CREATE_CONTENT_PERMISSION, weight=49)
 class AddLinkMenuDivider(MenuDivider):
     """Add links menu divider"""
 
@@ -58,8 +60,9 @@
 # Content link views
 #
 
-@viewlet_config(name='add-content-link.menu', context=ISiteContainer, layer=IAdminLayer, view=Interface,
-                manager=IToolbarAddingMenu, permission=CREATE_CONTENT_PERMISSION, weight=50)
+@viewlet_config(name='add-content-link.menu', context=ISiteContainer, layer=IAdminLayer,
+                view=ISiteTreeTable, manager=IToolbarAddingMenu,
+                permission=CREATE_CONTENT_PERMISSION, weight=50)
 class ContentLinkAddMenu(ToolbarMenuItem):
     """Content link add menu"""
 
@@ -79,14 +82,16 @@
 
 @pagelet_config(name='add-content-link.html', context=ISiteContainer, layer=IPyAMSLayer,
                 permission=CREATE_CONTENT_PERMISSION)
-@ajax_config(name='add-content-link.json', context=ISiteContainer, layer=IPyAMSLayer, base=AJAXAddForm)
+@ajax_config(name='add-content-link.json', context=ISiteContainer, layer=IPyAMSLayer,
+             base=AJAXAddForm)
 class ContentLinkAddForm(AdminDialogAddForm):
     """Content link add form"""
 
     legend = _("Rent existing content")
 
-    fields = field.Fields(IContentLinkAddFormFields).select('reference', 'navigation_title', 'show_header',
-                                                            'navigation_header', 'parent')
+    fields = field.Fields(IContentLinkAddFormFields).select('reference', 'navigation_title',
+                                                            'show_header', 'navigation_header',
+                                                            'parent')
     fields['show_header'].widgetFactory = SingleCheckBoxFieldWidget
     fields['parent'].widgetFactory = SiteManagerFoldersSelectorFieldWidget
 
@@ -166,7 +171,8 @@
 
     legend = _("Edit content link properties")
 
-    fields = field.Fields(IContentLink).select('reference', 'navigation_title', 'show_header', 'navigation_header')
+    fields = field.Fields(IContentLink).select('reference', 'navigation_title',
+                                               'show_header', 'navigation_header')
     fields['show_header'].widgetFactory = SingleCheckBoxFieldWidget
     edit_permission = MANAGE_CONTENT_PERMISSION
 
@@ -199,7 +205,8 @@
                 'event': 'myams.refresh',
                 'options': {
                     'handler': 'MyAMS.skin.refreshRow',
-                    'object_id': '{0}::{1}'.format(SiteContainerTreeTable.id, intids.queryId(self.context)),
+                    'object_id': '{0}::{1}'.format(SiteContainerTreeTable.id,
+                                                   intids.queryId(self.context)),
                     'row': table.renderRow(row)
                 }
             })
@@ -210,8 +217,9 @@
 # External content link views
 #
 
-@viewlet_config(name='add-external-link.menu', context=ISiteContainer, layer=IAdminLayer, view=Interface,
-                manager=IToolbarAddingMenu, permission=CREATE_CONTENT_PERMISSION, weight=60)
+@viewlet_config(name='add-external-link.menu', context=ISiteContainer, layer=IAdminLayer,
+                view=ISiteTreeTable, manager=IToolbarAddingMenu,
+                permission=CREATE_CONTENT_PERMISSION, weight=60)
 class ExternalContentLinkAddMenu(ToolbarMenuItem):
     """External content link add menu"""
 
@@ -231,13 +239,15 @@
 
 @pagelet_config(name='add-external-link.html', context=ISiteContainer, layer=IPyAMSLayer,
                 permission=CREATE_CONTENT_PERMISSION)
-@ajax_config(name='add-external-link.json', context=ISiteContainer, layer=IPyAMSLayer, base=AJAXAddForm)
+@ajax_config(name='add-external-link.json', context=ISiteContainer, layer=IPyAMSLayer,
+             base=AJAXAddForm)
 class ExternalContentLinkAddForm(AdminDialogAddForm):
     """External content link add form"""
 
     legend = _("Link external content")
 
-    fields = field.Fields(IExternalContentLinkAddFormFields).select('url', 'navigation_title', 'show_header',
+    fields = field.Fields(IExternalContentLinkAddFormFields).select('url', 'navigation_title',
+                                                                    'show_header',
                                                                     'navigation_header', 'parent')
     fields['parent'].widgetFactory = SiteManagerFoldersSelectorFieldWidget
 
@@ -277,7 +287,8 @@
         return {'status': 'reload'}
 
 
-@adapter_config(context=(IExternalContentLink, IPyAMSLayer, ISiteTreeTable), provides=ITableElementName)
+@adapter_config(context=(IExternalContentLink, IPyAMSLayer, ISiteTreeTable),
+                provides=ITableElementName)
 class ExternalContentLinkTableElementName(ContextRequestViewAdapter):
     """External content link table element name"""
 
@@ -302,7 +313,8 @@
     legend = _("Edit external content link properties")
     dialog_class = 'modal-large'
 
-    fields = field.Fields(IExternalContentLink).select('url', 'navigation_title', 'navigation_header')
+    fields = field.Fields(IExternalContentLink).select('url', 'navigation_title',
+                                                       'navigation_header')
     edit_permission = MANAGE_CONTENT_PERMISSION
 
     def updateWidgets(self, prefix=None):
@@ -321,7 +333,8 @@
                 'event': 'myams.refresh',
                 'options': {
                     'handler': 'MyAMS.skin.refreshRow',
-                    'object_id': '{0}::{1}'.format(SiteContainerTreeTable.id, intids.queryId(self.context)),
+                    'object_id': '{0}::{1}'.format(SiteContainerTreeTable.id,
+                                                   intids.queryId(self.context)),
                     'row': table.renderRow(row)
                 }
             })
--- a/src/pyams_content/shared/view/zmi/reference.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/shared/view/zmi/reference.py	Fri Nov 13 13:13:48 2020 +0100
@@ -33,13 +33,13 @@
 
 
 @viewlet_config(name='references.divider', context=IWfView, layer=IAdminLayer,
-                manager=IPropertiesMenu, permission=VIEW_SYSTEM_PERMISSION, weight=289)
+                manager=IPropertiesMenu, permission=VIEW_SYSTEM_PERMISSION, weight=299)
 class ViewReferencesMenuDivider(MenuDivider):
     """View references menu divider"""
 
 
 @viewlet_config(name='references.menu', context=IWfView, layer=IAdminLayer,
-                manager=IPropertiesMenu, permission=VIEW_SYSTEM_PERMISSION, weight=290)
+                manager=IPropertiesMenu, permission=VIEW_SYSTEM_PERMISSION, weight=300)
 class ViewReferencesMenu(MenuItem):
     """View references menu"""
 
--- a/src/pyams_content/workflow/notify.py	Fri Nov 13 13:11:29 2020 +0100
+++ b/src/pyams_content/workflow/notify.py	Fri Nov 13 13:13:48 2020 +0100
@@ -74,9 +74,12 @@
                             else:
                                 restrictions = IManagerRestrictions(notification_source, None)
                                 if restrictions is not None:
-                                    principal_restrictions = restrictions.get_restrictions(principal)
-                                    if principal_restrictions.check_access(notification_source,
-                                                                           MANAGE_CONTENT_PERMISSION):
+                                    principal_restrictions = restrictions.get_restrictions(
+                                        principal)
+                                    if principal_restrictions and \
+                                            principal_restrictions.check_access(
+                                                notification_source,
+                                                MANAGE_CONTENT_PERMISSION):
                                         principals.add(principal)
                         else:
                             principals.add(principal)