[Zope] ZClass permissions

Ross Patterson rossp@ppc.ucsc.edu
Thu, 14 Feb 2002 08:59:26 -0800 (PST)


Do this:

Make sure your authenticated as a manager, i.e. that you can view the
management pages.  THEN try and view the "Edit" management tab of
your instance and click cancel when it prompts you for authentication.
You'll then get an error page with a traceback in the source for the
page.  The dtml traceback will tell you what method you call in
your dtml is causing the problem.  Then you can try calling that
method directly and you can use that traceback to see where in that
method the problem is.  Then you can look at the source for that
method, go to the line number given in the method traceback, and that
should give you an indication what in your ZClass the method is trying
to access that it can't.  Then you can fix the problem in the Define
Permissions ZClass management tab.

But that would be the precise way that takes longer but yields a
greater understanding.  You could just map permissions to themselves
in the Define Permissions tab one by one until it works.

On Thu, 14 Feb 2002, Tom Nixon wrote:

> Hi Ross
>
> The method contains the following code, copied straight from the
> Formulator HOWTO. Any ideas what permissions need to be set, and where?
>
> <dtml-var standard_html_header>
>
>       <!-- show the header of the form, using 'Form action' and
>         'Form method' form settings (<form action="..." method="...">)
>         -->
>       <dtml-var "form.header()">
>
>       <!-- a simple table for layout purposes -->
>       <table border="0">
>
>       <!-- get a list of all fields in the form -->
>       <dtml-in "form.get_fields()">
>       <!-- rename each sequence item to 'field' so they can
>            be used more easily -->
>       <dtml-let field=sequence-item>
>
>       <!-- each field will be on a line by itself -->
>       <tr>
>       <!-- display the title property of this field -->
>       <td><dtml-var "field.get_value('title')"></td>
>       <!-- render the field -->
>       <td><dtml-var "field.render()"></td>
>       </tr>
>
>       </dtml-let>
>       </dtml-in>
>
>       <!-- the submit button -->
>       <tr>
>       <td><input type="submit" value=" OK "></td>
>       </tr>
>
>       </table>
>
>       <!-- the form footer -->
>       <dtml-var "form.footer()">
>
>       <dtml-var standard_html_footer>
>
>
>
> > -----Original Message-----
> > From: Ross Patterson [mailto:rossp@ppc.ucsc.edu]
> > Sent: 14 February 2002 16:13
> > To: Tom Nixon
> > Cc: zope@zope.org
> > Subject: Re: [Zope] ZClass permissions
> >
> >
> > I believe it depends on the actions the method is performing.
> >  If you look at (or post) the method actions, you can
> > probably guess what permission your zclass needs enabled.
> > Then you can go to the "Define Permissions" tab in your
> > ZClass management screen and enable that permission, probably
> > by mapping it to the very same permission in the list.
> >
> > On Thu, 14 Feb 2002, Tom Nixon wrote:
> >
> > > I have created a ZClass and a new View called "Edit" which
> > displays a
> > > DTML Method containing an automatically generated Formulator form
> > > (both situated inside the ZClass).
> > >
> > > However when I create an instance of the ZClass then click
> > the "edit"
> > > view, I am prompted to enter my username and password.
> > >
> > > If I change the DTML method to a simple "Hello World"
> > message it works
> > > fine, so it seems to be something to do with the Formulator form.
> > >
> > > Obviously there is a permission problem somewhere, but
> > where should I
> > > be looking?
> > >
> > > Zope Version  (Zope 2.5.0 (binary release, python 2.1, win32-x86),
> > > python 2.1.2, win32) Python Version  2.1.2 (#31, Jan 15 2002,
> > > 17:28:11) [MSC 32 bit (Intel)]
> > >
> > > System Platform  win32
> > >
> > > T.
> > >
> > >
> > > _______________________________________________
> > > Zope maillist  -  Zope@zope.org
> > > http://lists.zope.org/mailman/listinfo/zope
> > > **   No cross posts or HTML encoding!  **
> > > (Related lists -
> > http://lists.zope.org/mailman/listinfo/zope-> announce
> > >
> > http://lists.zope.org/mailman/listinfo/zope-dev
> > )
> > >
> >
> > -----------------------------------------------------------------
> > | Ross Patterson			rossp@cats.ucsc.edu	|
> > | Programmer/Analyst			(831)459-2792		|
> > | Physical Planning & Construction	Fax:(831)423-7436	|
> > | UC Santa Cruz
> > http:www2.ucsc.edu/ppc	|
> > -----------------------------------------------------------------
> >
>
>

-----------------------------------------------------------------
| Ross Patterson			rossp@cats.ucsc.edu	|
| Programmer/Analyst			(831)459-2792		|
| Physical Planning & Construction	Fax:(831)423-7436	|
| UC Santa Cruz				http:www2.ucsc.edu/ppc	|
-----------------------------------------------------------------