--- a/src/pyams_workflow/content.py Fri Jun 22 09:11:25 2018 +0200
+++ b/src/pyams_workflow/content.py Fri Jun 22 12:51:31 2018 +0200
@@ -172,6 +172,8 @@
(self.publication_expiration_date >= now))
def is_visible(self, request=None, check_parent=True):
+ if request is None:
+ request = check_request()
# associated workflow?
content = IWorkflowManagedContent(self.__parent__, None)
if content is not None:
@@ -179,11 +181,9 @@
if not wf_name:
return True
# check workflow?
- if content.view_permission:
- if request is None:
- request = check_request()
- if not request.has_permission(content.view_permission, context=self.__parent__):
- return False
+ if content.view_permission and \
+ not request.has_permission(content.view_permission, context=self.__parent__):
+ return False
else:
if not request.has_permission(VIEW_PERMISSION, context=self.__parent__):
return False