[Zope-CMF] Problems editing DC Metadata: portal_discussion ????

Doyon, Jean-Francois Jean-Francois.Doyon@CCRS.NRCan.gc.ca
Wed, 7 Aug 2002 12:52:40 -0400


Hello,

I have two sites: one production, and one for development.  For the
development site, I just copied the Data.fs (And a few scripts and so =
on)
from one to the other, which seems to have worked fine.

The problem now is this:

When a user tries to edit the metadata on a custom object (didn't try =
others
... yet), he gets prompted to log in ... But of course he allready is.
Turns out the error is this:

<snip ...>
  File =
/usr/local/Zope-2.5.0/lib/python/Products/CMFCore/FSPythonScript.py,
line 115, in _exec
    (Object: metadata_edit)
    (Info: ({'script': <FSPythonScript instance at 8c73e48>, 'context':
<MSMap instance at 9514528>, 'container': <CMFSite instance at =
8b8b938>,
'traverse_subpath': []}, (None, '', [''], '', None, None, None, =
'text/html',
None, None), {}, (None, None, None, None, None, None, None, None, None,
None)))
  File Script (Python), line 40, in metadata_edit
  File
/usr/local/Zope-2.5.0/lib/python/Products/CMFDefault/DiscussionTool.py, =
line
65, in overrideDiscussionFor
    (Object: portal_discussion)
Unauthorized

After doing some digging, I found the following line in =
metadata_edit.py:

context.portal_discussion.overrideDiscussionFor(context, =
allowDiscussion)

Which eventually causes an error in CMFDefault/DisucssionTool.py at:

        mtool =3D getToolByName( self, 'portal_membership' )
        if not mtool.checkPermission( =
CMFCorePermissions.ModifyPortalContent
                                    , content
                                    ):
            raise "Unauthorized"

BTW, this is Zope 2.5.0 with CMF 1.1 ...

Now said user can perform the metadata editing on the production server =
no
problem, but not on the development server.  Since it's a copy of =
Data.fs,
the permissions are all exactly the same (He does NOT have the
"ModifyPortalContent" permission!) on both servers ... He owns the =
object
he's trying to edit the metadata ON though.

Of course now that I see this, I'm confused, and wondering why it DOES =
work,
since it seems they should both raise an error ??? But where is the
difference between the two ? Could it be the fact that on the =
production
server there's a squid cache that maybe does funny things to =
headers/cookie
? What is this permission "Modifiy Portal Content" for exactly anyways =
?

Any insight into this would be greatly appreciated :)

Thanks,

Jean-Fran=E7ois Doyon
Internet Service Development and Systems Support
GeoAccess Division
Canadian Center for Remote Sensing
Natural Resources Canada
http://atlas.gc.ca
Phone: (613) 992-4902
Fax: (613) 947-2410