Commit 076269ff authored by Jérome Perrin's avatar Jérome Perrin

allow class SQLBrain in restricted code, as it is now available directly in...

allow class SQLBrain in restricted code, as it is now available directly in listbox methods when they use objectValues as list method since this commit :
http://cvs.erp5.org/ERP5Form/ListBox.py?r1=2.93&r2=2.94


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4163 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 87722f78
......@@ -17,9 +17,14 @@ import Acquisition
import sys
from ZODB.POSException import ConflictError
from AccessControl import ClassSecurityInfo
from AccessControl.SecurityInfo import allow_class
from zLOG import LOG
class ZSQLBrain(Acquisition.Implicit):
security = ClassSecurityInfo()
security.declareObjectPublic()
o_self = None
......@@ -78,21 +83,22 @@ class ZSQLBrain(Acquisition.Implicit):
return self.path
def resolve_url(self, path, REQUEST):
"""
Taken from ZCatalog
Attempt to resolve a url into an object in the Zope
namespace. The url may be absolute or a catalog path
style url. If no object is found, None is returned.
No exceptions are raised.
"""
script=REQUEST.script
if string.find(path, script) != 0:
path='%s/%s' % (script, path)
try:
return REQUEST.resolve_url(path)
except ConflictError:
raise
except:
pass
"""
Taken from ZCatalog
Attempt to resolve a url into an object in the Zope
namespace. The url may be absolute or a catalog path
style url. If no object is found, None is returned.
No exceptions are raised.
"""
script=REQUEST.script
if string.find(path, script) != 0:
path='%s/%s' % (script, path)
try:
return REQUEST.resolve_url(path)
except ConflictError:
raise
except:
pass
allow_class(ZSQLBrain)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment