Mercurial > hg > documentViewer
comparison documentViewer.py @ 45:0391fe75aef3
fixed handling of documents with missing access tag
author | casties |
---|---|
date | Wed, 26 Jul 2006 14:23:55 +0200 |
parents | f3bc59cf64d9 |
children | 31059e3d9338 |
comparison
equal
deleted
inserted
replaced
44:4b519fc6a5a0 | 45:0391fe75aef3 |
---|---|
141 | 141 |
142 def isAccessible(self, docinfo): | 142 def isAccessible(self, docinfo): |
143 """returns if access to the resource is granted""" | 143 """returns if access to the resource is granted""" |
144 access = docinfo.get('accessType', None) | 144 access = docinfo.get('accessType', None) |
145 zLOG.LOG("documentViewer (accessOK)", zLOG.INFO, "access type %s"%access) | 145 zLOG.LOG("documentViewer (accessOK)", zLOG.INFO, "access type %s"%access) |
146 if access is None: | 146 if access is not None and access == 'free': |
147 # no information - no access | |
148 return False | |
149 elif access == 'free': | |
150 zLOG.LOG("documentViewer (accessOK)", zLOG.INFO, "access is free") | 147 zLOG.LOG("documentViewer (accessOK)", zLOG.INFO, "access is free") |
151 return True | 148 return True |
152 elif access in self.authgroups: | 149 elif access is None or access in self.authgroups: |
153 # only local access -- only logged in users | 150 # only local access -- only logged in users |
154 user = getSecurityManager().getUser() | 151 user = getSecurityManager().getUser() |
155 if user is not None: | 152 if user is not None: |
156 #print "user: ", user | 153 #print "user: ", user |
157 return (user.getUserName() != "Anonymous User") | 154 return (user.getUserName() != "Anonymous User") |