[Zope] Creating PythonMethod from ZClass constructor/method.

Jeff Hoffman jeff.hoffman@goingv.com
Wed, 28 Jun 2000 20:04:44 -0400 (EDT)


Hello,

Using Zope 2.2b3, I am trying to create a PythonMethod from the
constructor of my ZClass and keep getting an authorization dialog. In my
MyZClass_add method, I have:

  <dtml-with "MyZClass.createInObjectManager(...)">
      <dtml-call "manage_addFolder(id='testFolder')"> <!-- works! -->
      <dtml-with "manage_addProduct['PythonMethod']">
          <dtml-call "manage_addPythonMethod(
              this(),
              'testMethod',
              'Test Method',
              'self',
              'pass'
          )">
      </dtml-with>
  </dtml-with>

Every pemutation I have tried gives the same result: an Unauthorized
exception.

Adding the Python Method by hand works fine, as does adding one using the
following URL:

http://localhost/sandbox/myInstance/manage_addProduct/
  PythonMethod/manage_addPythonMethod?id=foo&title=bar&...

If there is one thing I am weak on in Zope, it's permissions. I am
assuming there is something wrong with the way mine are set up, but I have
no clue what the correct solution is.

I haven't had the time to try another Python product, but I am guessing
that this problem is not specific to Python Methods; I believe I would run
into this same situation trying to add an instance of any python product
to my ZClass instance.

Anyone have an idea?

--Jeff

---
Jeff K. Hoffman                               704.849.0731 x108
Chief Technology Officer                      mailto:jeff.hoffman@goingv.com
Going Virtual, L.L.C.                         http://www.goingv.com/