Commit 80231bc0 authored by Jim Fulton's avatar Jim Fulton

Fixed bug in setting default propertysheet properties. Yippi!

Now when a propertysheet is created, it is usable by anyone who
has "Manage properties".  I also got rid of the ineffective
"access contents information" permission, since this won't have an effect
until we add ZClass propertysheets with their own namespaces.
parent f2640809
...@@ -96,13 +96,13 @@ class ClassCaretaker: ...@@ -96,13 +96,13 @@ class ClassCaretaker:
def __setattr__(self, name, v): def __setattr__(self, name, v):
klass=self._k klass=self._k
setattr(klass, name, v) setattr(klass, name, v)
if not klass._p_changed: if not getattr(klass,'_p_changed',None):
get_transaction().register(klass) get_transaction().register(klass)
klass._p_changed=1 klass._p_changed=1
def __delattr__(self, name): def __delattr__(self, name):
klass=self._k klass=self._k
delattr(klass, name) delattr(klass, name)
if not klass._p_changed: if not getattr(klass,'_p_changed',None):
get_transaction().register(klass) get_transaction().register(klass)
klass._p_changed=1 klass._p_changed=1
...@@ -297,7 +297,7 @@ class ZCommonSheet(OFS.PropertySheets.PropertySheet, OFS.SimpleItem.Item): ...@@ -297,7 +297,7 @@ class ZCommonSheet(OFS.PropertySheets.PropertySheet, OFS.SimpleItem.Item):
manage_tabs_message='The permission mapping has been updated') manage_tabs_message='The permission mapping has been updated')
property_sheet_permissions=( property_sheet_permissions=(
'Access contents information', # 'Access contents information',
'Manage properties', 'Manage properties',
) )
...@@ -306,8 +306,8 @@ class ZInstanceSheet(OFS.PropertySheets.FixedSchema, ...@@ -306,8 +306,8 @@ class ZInstanceSheet(OFS.PropertySheets.FixedSchema,
): ):
"Waaa this is too hard" "Waaa this is too hard"
_Manage_properties_Permission='Manage properties' _Manage_properties_Permission='_Manage_properties_Permission'
_Access_contents_information_Permission='View' _Access_contents_information_Permission='_View_Permission'
__ac_permissions__=( __ac_permissions__=(
('Manage properties', ('manage_addProperty', ('Manage properties', ('manage_addProperty',
...@@ -327,7 +327,7 @@ class ZInstanceSheet(OFS.PropertySheets.FixedSchema, ...@@ -327,7 +327,7 @@ class ZInstanceSheet(OFS.PropertySheets.FixedSchema,
Globals.default__class_init__(ZInstanceSheet) Globals.default__class_init__(ZInstanceSheet)
def rclass(klass): def rclass(klass):
if klass._p_changed==0: if not getattr(klass, '_p_changed', 0):
get_transaction().register(klass) get_transaction().register(klass)
klass._p_changed=1 klass._p_changed=1
...@@ -354,7 +354,8 @@ class ZInstanceSheetsSheet(OFS.PropertySheets.View, ...@@ -354,7 +354,8 @@ class ZInstanceSheetsSheet(OFS.PropertySheets.View,
def _delOb(self, id): def _delOb(self, id):
delattr(self, id) delattr(self, id)
pc=self.aq_inner.aq_parent.aq_parent._zclass_propertysheets_class pc=self.aq_inner.aq_parent.aq_parent._zclass_propertysheets_class
delattr(pc,id) try: delattr(pc,id)
except: pass
pc.__propset_attrs__=tuple(map(lambda o: o['id'], self._objects)) pc.__propset_attrs__=tuple(map(lambda o: o['id'], self._objects))
rclass(pc) rclass(pc)
......
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