Commit 54b4525e authored by 's avatar

- made InitializeClass the default name

parent e9a4608e
...@@ -7,21 +7,24 @@ ...@@ -7,21 +7,24 @@
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE # FOR A PARTICULAR PURPOSE.
# #
############################################################################## ##############################################################################
"""Class initialization.
$Id$
"""
import logging import logging
from AccessControl.Permission import ApplicationDefaultPermissions # BBB from AccessControl.Permission import ApplicationDefaultPermissions # BBB
def InitializeClass(self):
def default__class_init__(self):
from AccessControl.Permission import registerPermissions from AccessControl.Permission import registerPermissions
from AccessControl.PermissionRole import PermissionRole from AccessControl.PermissionRole import PermissionRole
dict=self.__dict__ dict=self.__dict__
have=dict.has_key have=dict.has_key
ft=type(default__class_init__) ft=type(InitializeClass)
dict_items=dict.items() dict_items=dict.items()
for name, v in dict_items: for name, v in dict_items:
...@@ -71,7 +74,7 @@ def default__class_init__(self): ...@@ -71,7 +74,7 @@ def default__class_init__(self):
roles = acp[2] roles = acp[2]
pr = PermissionRole(pname, roles) pr = PermissionRole(pname, roles)
else: else:
pr=PermissionRole(pname) pr = PermissionRole(pname)
for mname in mnames: for mname in mnames:
setattr(self, mname+'__roles__', pr) setattr(self, mname+'__roles__', pr)
if mname and not hasattr(self, mname): if mname and not hasattr(self, mname):
...@@ -80,4 +83,4 @@ def default__class_init__(self): ...@@ -80,4 +83,4 @@ def default__class_init__(self):
"nonexistent method %r", self.__module__, "nonexistent method %r", self.__module__,
self.__name__, mname) self.__name__, mname)
InitializeClass = default__class_init__ # instead of Globals.Initialize default__class_init__ = InitializeClass # BBB: old name
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