"Roch�" == Roch� Compaan <roche@upfrontsystems.co.za> writes:
Roch�> Yes, all classes subclassing RoleManager has a Roch�> manage_permission method that can be used to change Roch�> permissions. You could for instance put the following in Roch�> manage_afterAdd of your class to give only Manager and Roch�> Administrator the 'View' permission and prevent this Roch�> permission from being acquired: Next problem: I have a class (derived from folder) MyFolder that I am instantiating from the web interface. In the manage_afterAdd function of that class, I am instantiating several other objects (MyObject) that reside in MyFolder. These objects are not meant to be instantiated by users, and will only be instantiated by MyFolder when it created. I also want to set the default permissions and roles for MyObject. If I define manage_afterAdd in MyObject, the function is not called, presumably because I am not instantiating MyObject from the manager interface. In MyFolder.manage_afterAdd, I do o = MyObject(oid) self._setObject(oid, o)
From product code, is there a way to add a MyObject instance to MyFolder so that MyObject.manage_afterAdd(self, item, container) will be called with self properly wrapped to make the role manager manage_permissions calls?
Thanks again, John Hunter zope 2.7