[Zope] adding class instance

John Hunter jdhunter@ace.bsd.uchicago.edu
Thu, 02 May 2002 13:32:03 -0500


[This is related to a question I posted earlier but have been unable to
solve it.  I am reposting with more accurate and detailed information]

In the Zope management interface, I have created a Product NewProduct
which contains a ZClass NewClass.  I have installed and instance of
NewProduct at

http::/myhost.com:8080/summer/jdh/newtest

If I visit http::/myhost.com:8080/summer/jdh/newtest/manage with
Manager privileges for the newtest folder, I can add New Class
instances to that folder.  All is well.

I would like, however, to have a file
http::/myhost.com:8080/summer/jdh/newtest/index_html where the manager
could add New Class instances without entering the manager interface,
with something like:

   <a href="Control_Panel/Products/NewProduct/NewClass_addForm">
      add a new class
   </a>

But this gives me get an unauthorized access error because zope is
trying to create the class instance in the
Control_Panel/Products/NewProduct/ folder which the newtest manager
does not have access to.  If I use the link above as a root manager,
the NewClass instance is created in
Control_Panel/Products/NewProduct/.

If I try:
   <a href="/Control_Panel/Products/NewProduct/summer/jdh/newtest/NewClass_addForm">
      add a new class
   </a>

which from my read of the zope book is how it should be done, I get
the error:

          Error Type: NameError
          Error Value: global name 'NewClass' is not defined

The offending line in NewClass_add is

     <dtml-with "NewClass.createInObjectManager(REQUEST['id'], REQUEST)">

Can someone advise me how to proceed to enable a properly
authenticated user to add a NewClass instance without visiting the
manager interface?


Thanks,
John Hunter