Add an accessor method for title. As title is part of the interface

IComment for which we <require> 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
This commit is contained in:
Carsten Senger 2009-08-20 02:06:15 +00:00
parent 4da4ab3599
commit e946ef7979
2 changed files with 6 additions and 2 deletions

View File

@ -65,6 +65,10 @@ class Comment(DynamicType, Traversable, RoleManager, Owned, Implicit):
""" """
return self.id return self.id
def getText(self):
'''the text'''
return self.text
def Title(self): def Title(self):
"""The title of the comment """The title of the comment
""" """

View File

@ -21,7 +21,7 @@
<!-- Comments --> <!-- Comments -->
<class class=".comment.Comment"> <class class=".comment.Comment">
<require interface=".interfaces.IComment" permission="zope2.View" /> <require interface=".interfaces.IComment" permission="zope2.View" />
<require attributes="Title Creator getId" permission="zope2.View" /> <require attributes="Title Creator getId getText" permission="zope2.View" />
</class> </class>
<utility <utility