changeset 45:0391fe75aef3

fixed handling of documents with missing access tag
author casties
date Wed, 26 Jul 2006 14:23:55 +0200
parents 4b519fc6a5a0
children 31059e3d9338
files documentViewer.py zpt/changeDocumentViewer.zpt
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/documentViewer.py	Tue Jul 18 19:04:23 2006 +0200
+++ b/documentViewer.py	Wed Jul 26 14:23:55 2006 +0200
@@ -143,13 +143,10 @@
         """returns if access to the resource is granted"""
         access = docinfo.get('accessType', None)
         zLOG.LOG("documentViewer (accessOK)", zLOG.INFO, "access type %s"%access)
-        if access is None:
-            # no information - no access 
-            return False
-        elif access == 'free':
+        if access is not None and access == 'free':
             zLOG.LOG("documentViewer (accessOK)", zLOG.INFO, "access is free")
             return True
-        elif access in self.authgroups:
+        elif access is None or access in self.authgroups:
             # only local access -- only logged in users
             user = getSecurityManager().getUser()
             if user is not None:
--- a/zpt/changeDocumentViewer.zpt	Tue Jul 18 19:04:23 2006 +0200
+++ b/zpt/changeDocumentViewer.zpt	Wed Jul 26 14:23:55 2006 +0200
@@ -1,5 +1,8 @@
 <div tal:replace="structure here/manage_page_header">Header</div>
-	<h2>Add a Document Viewer</h2>
+<!-- ZOPE management tabs -->
+<h2 tal:define="manage_tabs_message options/manage_tabs_message | nothing"
+    tal:replace="structure here/manage_tabs">Tabs</h2>
+<!-- end of ZOPE management tabs -->
 		<form action="changeDocumentViewer">
 		
 		<p class="form-optional">Title</p>