On Mon, 2003-03-17 at 04:31, [EMAIL PROTECTED] wrote:
> I am trying to develop a program that generates a top-level folder
within zope and then has one of its functions called to give permission
to access the folder, as opposed to using the standard Zope permission

I don't think you really need this. Zope authentication/authorization
machinery is so flexible that there's usually a way to code whatever you
want to achieve thru it instead of around it.

> As I understand it the only way to do this is to modify the core zope

I don't think you need this either. Zope authentication machinery is
very plugable. At the very worst, I think you could get around it by
creating a class that inherits from Folder and instantiate from that

> Am I correct or is there another way to do it?

There probably is, but it'd be better if we understood what you're
trying to do. Try to tell us what you are trying to achieve instead of
how you plan on doing it :-)

> I have looked at OFS.ObjectManager and discovered that the functions
_getobj, _setobj, and _delobj are called to get, set and delete an
object. Presumably, if I raised an exception here, it would cause the
operation to not suceed.

Yes, but you don't have to change ObjectManager for that. As I mentioned
before, you could inherit from folder, override ._setobj() and raise an
exception before calling 'Folder._setobj(self, ...)'. You can also raise
an exception after you've called those methods, as long as you are still
in the same transaction. If the exception is not caught, it aborts the
transaction and any changes that happened since it's begining will be

> I have also figured out how to get the ID and Title of the file, but I
can't get the absolute path. 
> How do I tell the absolute path of a file from within OFS.ObjectManager?

file.getPhysicalPath() will give you a tuple representation of the
object absolute path. '"/".join(file.getPhysicalPath())' will get you
the string representation.

> And, is modifying OFS.ObjectManager to call the function in my program
the best place to modify the core of zope?

As I said, there are a number of options to try before you modify Zope
core :-)

Cheers, Leo

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to