Commit fe0aada9 authored by Jérome Perrin's avatar Jérome Perrin

use a Length object instead of an integer for security_uid_index.

Length instances are stored independantly in the ZODB, and as this property is
somehow often changed, it's better to have only a Length modified, not a
SQLCatalog. Also, without this, the history tab from the ZMI of the SQLCatalog
is unusable.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13595 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 900dd720
......@@ -874,7 +874,7 @@ class Catalog( Folder,
def _clearSecurityCache(self):
self.security_uid_dict = OIBTree()
self.security_uid_index = 0
self.security_uid_index = Length()
security.declarePrivate('getSecurityUid')
def getSecurityUid(self, wrapped_object):
......@@ -895,9 +895,10 @@ class Catalog( Folder,
self._clearSecurityCache()
if self.security_uid_dict.has_key(allowed_roles_and_users):
return (self.security_uid_dict[allowed_roles_and_users], None)
self.security_uid_index = self.security_uid_index + 1
self.security_uid_dict[allowed_roles_and_users] = self.security_uid_index
return (self.security_uid_index, allowed_roles_and_users)
self.security_uid_index.change(1)
security_uid = self.security_uid_index()
self.security_uid_dict[allowed_roles_and_users] = security_uid
return (security_uid, allowed_roles_and_users)
def clear(self):
"""
......
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