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 ...@@ -17,9 +17,14 @@ import Acquisition
import sys import sys
from ZODB.POSException import ConflictError from ZODB.POSException import ConflictError
from AccessControl import ClassSecurityInfo
from AccessControl.SecurityInfo import allow_class
from zLOG import LOG from zLOG import LOG
class ZSQLBrain(Acquisition.Implicit): class ZSQLBrain(Acquisition.Implicit):
security = ClassSecurityInfo()
security.declareObjectPublic()
o_self = None o_self = None
...@@ -78,21 +83,22 @@ class ZSQLBrain(Acquisition.Implicit): ...@@ -78,21 +83,22 @@ class ZSQLBrain(Acquisition.Implicit):
return self.path return self.path
def resolve_url(self, path, REQUEST): def resolve_url(self, path, REQUEST):
""" """
Taken from ZCatalog Taken from ZCatalog
Attempt to resolve a url into an object in the Zope Attempt to resolve a url into an object in the Zope
namespace. The url may be absolute or a catalog path namespace. The url may be absolute or a catalog path
style url. If no object is found, None is returned. style url. If no object is found, None is returned.
No exceptions are raised. No exceptions are raised.
""" """
script=REQUEST.script script=REQUEST.script
if string.find(path, script) != 0: if string.find(path, script) != 0:
path='%s/%s' % (script, path) path='%s/%s' % (script, path)
try: try:
return REQUEST.resolve_url(path) return REQUEST.resolve_url(path)
except ConflictError: except ConflictError:
raise raise
except: except:
pass 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