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:
parent
4da4ab3599
commit
e946ef7979
@ -65,6 +65,10 @@ class Comment(DynamicType, Traversable, RoleManager, Owned, Implicit):
|
||||
"""
|
||||
return self.id
|
||||
|
||||
def getText(self):
|
||||
'''the text'''
|
||||
return self.text
|
||||
|
||||
def Title(self):
|
||||
"""The title of the comment
|
||||
"""
|
||||
|
@ -21,7 +21,7 @@
|
||||
<!-- Comments -->
|
||||
<class class=".comment.Comment">
|
||||
<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>
|
||||
|
||||
<utility
|
||||
|
Loading…
Reference in New Issue
Block a user