Commit eee81411 authored by Shane Hathaway's avatar Shane Hathaway

Modified Chris's factory bug fix to not interfere with .zexp import.

parent 8561d0d6
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
############################################################################## ##############################################################################
__doc__='''Factory objects __doc__='''Factory objects
$Id: Factory.py,v 1.19 2000/08/07 15:44:26 brian Exp $''' $Id: Factory.py,v 1.20 2000/08/14 14:34:23 shane Exp $'''
__version__='$Revision: 1.19 $'[11:-2] __version__='$Revision: 1.20 $'[11:-2]
import OFS.SimpleItem, Acquisition, Globals, AccessControl.Role import OFS.SimpleItem, Acquisition, Globals, AccessControl.Role
import Products, Product import Products, Product
...@@ -123,6 +123,11 @@ class Factory( ...@@ -123,6 +123,11 @@ class Factory(
self.initial=initial self.initial=initial
self.permission=permission self.permission=permission
initializePermission__roles__ = ()
def initializePermission(self):
self.manage_setPermissionMapping(('Use Factories',),
(self.permission,))
def manage_edit(self, title, object_type, initial, permission='', def manage_edit(self, title, object_type, initial, permission='',
REQUEST=None): REQUEST=None):
"Modify factory properties." "Modify factory properties."
...@@ -140,8 +145,6 @@ class Factory( ...@@ -140,8 +145,6 @@ class Factory(
container=self.aq_parent container=self.aq_parent
elif item is not self: elif item is not self:
container=None container=None
self.manage_setPermissionMapping(('Use Factories',),
(self.permission,))
if (item is self or if (item is self or
getattr(container, '__class__', None) is Product.Product): getattr(container, '__class__', None) is Product.Product):
self._register() self._register()
......
...@@ -204,6 +204,8 @@ class Product(Folder, PermissionManager): ...@@ -204,6 +204,8 @@ class Product(Folder, PermissionManager):
' ' ' '
i=Factory(id, title, object_type, initial, permission) i=Factory(id, title, object_type, initial, permission)
self._setObject(id,i) self._setObject(id,i)
factory = self._getOb(id)
factory.initializePermission()
if REQUEST is not None: if REQUEST is not None:
return self.manage_main(self,REQUEST,update_menu=1) return self.manage_main(self,REQUEST,update_menu=1)
......
...@@ -126,6 +126,8 @@ class ZClassMethodsSheet( ...@@ -126,6 +126,8 @@ class ZClassMethodsSheet(
' ' ' '
i=App.Factory.Factory(id, title, object_type, initial, permission) i=App.Factory.Factory(id, title, object_type, initial, permission)
self._setObject(id,i) self._setObject(id,i)
factory = self._getOb(id)
factory.initializePermission()
if REQUEST is not None: if REQUEST is not None:
return self.manage_main(self,REQUEST,update_menu=1) return self.manage_main(self,REQUEST,update_menu=1)
......
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