[Zope-CMF] Administering CMF discussions

Pieter Claerhout pieter.claerhout@pandora.be
Tue, 15 Jan 2002 23:16:53 +0100


This doesn't seem to work for CMF 1.1, is there a way around?

Cheers,


Pieter


-----Original Message-----
From: zope-cmf-admin@zope.org [mailto:zope-cmf-admin@zope.org]On Behalf
Of Tres Seaver
Sent: Tuesday, January 15, 2002 10:05 PM
To: D.Turpie@open.ac.uk
Cc: Zope-Cmf
Subject: Re: [Zope-CMF] Administering CMF discussions


D.Turpie@open.ac.uk wrote:

> Tres
>
> I have managed to make discussion editable by adding the action to the
> 'DiscussionItem' type object.
>
> I however am not clear on how or what I need to do to be able to delete
> discussion items.
>
> You said
>
> 	"The current discussions UI reflects a policy that discussions are
> 	immutable;  to change the policy, you will need to add a custom skin
> 	to expose the method, 'deleteReply' (found in class,
> 	CMFDefault.DiscussionItem.DiscussionItemContainer).  This method is
> 	protected by the 'Manage portal' permission."
>
> Could you explain this further or in simpler terms.
>
> Sorry from a newbie...

You will need to add a skin method, e.g., 'discitem_delete', which

operates on the 'talkback' object of the discussed content, e.g.::

   ## Script (Python) "discitem_delete"
   ## parameters=
   ## title=Delete discussion item
   parent = context.inReplyTo()
   talkback = context.portal_discussion.getDiscussionFor()
   talkback.deleteReply( context.getId() )

   context.REQUEST['RESPONSE'].redirect( parent.absolute_url()
             + '?portal_status_message=Reply+deleted' )


Then create an action for DiscussionItem (like the one you made
for edit) which has 'discitem_delete' as its action.  The
permission which governs 'deleteReply' is 'Manage portal', so
you won't be able to let others besides managers use the action
unless you write it as an ExternalMethod, or give it proxy roles.

Tres.
--
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com


_______________________________________________
Zope-CMF maillist  -  Zope-CMF@zope.org
http://lists.zope.org/mailman/listinfo/zope-cmf

See http://www.zope.org/Products/PTK/Tracker for bug reports and feature
requests