From e946ef79794d959643197a2a3961e4709a7e8e6d Mon Sep 17 00:00:00 2001 From: Carsten Senger Date: Thu, 20 Aug 2009 02:06:15 +0000 Subject: [PATCH] Add an accessor method for title. As title is part of the interface IComment for which we zope2.View a permission check will raise Unauthorized cause we can not assure that the user's userfolder is in the acqusition chain of the object (the attribute is a bare unicode object). It works for methods. im_self is used to get the acquisition wrapped object. svn path=/plone.app.discussion/trunk/; revision=29199 --- plone/app/discussion/comment.py | 6 +++++- plone/app/discussion/configure.zcml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plone/app/discussion/comment.py b/plone/app/discussion/comment.py index b6ef470..c6bb031 100644 --- a/plone/app/discussion/comment.py +++ b/plone/app/discussion/comment.py @@ -64,6 +64,10 @@ class Comment(DynamicType, Traversable, RoleManager, Owned, Implicit): """The id of the comment, as a string """ return self.id + + def getText(self): + '''the text''' + return self.text def Title(self): """The title of the comment @@ -104,4 +108,4 @@ def notify_content_object(obj, event): """Tell the content object when a comment is added """ content_obj = aq_parent(aq_parent(obj)) - content_obj.reindexObject(idxs=('total_comments', 'last_comment_date', 'commentators',)) \ No newline at end of file + content_obj.reindexObject(idxs=('total_comments', 'last_comment_date', 'commentators',)) diff --git a/plone/app/discussion/configure.zcml b/plone/app/discussion/configure.zcml index d44d6a0..a5178a5 100644 --- a/plone/app/discussion/configure.zcml +++ b/plone/app/discussion/configure.zcml @@ -21,7 +21,7 @@ - +