# HG changeset patch # User Thierry Florac # Date 1511886297 -3600 # Node ID aaf2eac56470b00641185208156db67cb6668382 # Parent fb84bba1880f5e91846b3fc1c720d50d0475e09e Added condition for message about allowed paragraph types diff -r fb84bba1880f -r aaf2eac56470 src/pyams_content/component/paragraph/zmi/container.py --- a/src/pyams_content/component/paragraph/zmi/container.py Sun Nov 26 09:58:35 2017 +0100 +++ b/src/pyams_content/component/paragraph/zmi/container.py Tue Nov 28 17:24:57 2017 +0100 @@ -116,11 +116,13 @@ if not self.values: translate = self.request.localizer.translate message = translate(_("No currently defined paragraph.")) - manager = get_parent(self.context, IParagraphFactorySettings) - if (manager is not None) and not manager.allowed_paragraphs: - message = '{0}
{1}'.format(message, - translate(_("Check allowed paragraph types to be able to create new " - "paragraphs."))) + permission = self.permission + if (not permission) or self.request.has_permission(permission, self.context): + manager = get_parent(self.context, IParagraphFactorySettings) + if (manager is not None) and not manager.allowed_paragraphs: + message = '{0}
{1}'.format(message, + translate(_("Check allowed paragraph types to be able to create " + "new paragraphs."))) return message return super(ParagraphContainerBaseTable, self).render() @@ -162,10 +164,10 @@ def get_icon(self, item): if item.visible: - icon_class = 'fa fa-fw fa-eye' + icon_class = 'fa-eye' else: - icon_class = 'fa fa-fw fa-eye-slash text-danger' - return ''.format(icon_class=icon_class) + icon_class = 'fa-eye-slash text-danger' + return ''.format(icon_class=icon_class) def renderCell(self, item): if self.permission and not self.request.has_permission(self.permission, context=item):