[Zope] Newbie: Ownership confusion

Chris Withers chrisw@nipltd.com
Wed, 10 Jul 2002 10:17:44 +0100

Rebecca.R.Hepper@seagate.com wrote:
> Yep, the code is as shown below.  If admin creates the folder in the
> management screen, 'folder' gets chosen from the 'Select Type To Add' drop
> down box.  If other users add a folder, I go to the 'folder contents' area
> then choose 'New' and add a folder.

Ah, okay, you didn't mention you were using the CMF ;-)

That makes things a lot more understandable...

> Rebecca.R.Hepper@seagate.com wrote:
> >
> >  <table tal:define="myhere root/myportal/topfolder/folderA">
> >  <tr valign="top" align="left" tal:repeat="folders
> > python:myhere.objectValues('Folder')">
> >    <td><input type="radio" name="release" value="folders" tal:attributes
> > ="value folders/title"></td>
> >  </tr>
> >
> > I run into problems depending on who owns the subfolders in folderA.  If
> > admin created the folderA/subfolder, the form will display a radio button
> > for the folder.  If anyone else (i.e. manager, owner, member) creates the
> > subfolder, it will not be displayed.

That's because you're creating different types of object ;-)
When you go in as admin (through the management interface, I'm guessing?), you're creating
'Folder' objects. When you go in through the folder_contents intefrace, you're creating
'Portal Folder' objects.


What you actually want is:

1. Always create your folders through the folder_contents interace, even if you're admin.

2. change your code above to:

<table tal:define="myhere root/myportal/topfolder/folderA">
 <tr valign="top" align="left" 
     tal:repeat="folders python:myhere.contentValues(filter={'Type': 'Folder'})">
   <td><input type="radio" name="release" value="folders" 
              tal:attributes="value folders/title"></td>