Permalink
Browse files

use defined accesscontrol, fix portletmanager rename

  • Loading branch information...
1 parent 12e1cda commit fb9fc776f63587a70a1a3ca7cfca717ab65ff4fb @gyst gyst committed May 21, 2012
View
12 plonesocial/activitystream/browser/activitystream_portlet.py
@@ -116,7 +116,10 @@ def update(self):
if self.data.show_microblog:
container = queryUtility(IMicroblogTool)
- statuses = container.values(limit=self.data.count)
+ try:
+ statuses = container.values(limit=self.data.count)
+ except Unauthorized:
+ statuses = []
else:
statuses = []
@@ -159,14 +162,17 @@ def can_view(self, activity):
"""Returns true if current user has the 'View' permission.
"""
sm = getSecurityManager()
- if activity.is_discussion:
+ if activity.is_status:
+ permission = "Plone Social: View Microblog Status Update"
+ return sm.checkPermission(permission, self.context)
+ elif activity.is_discussion:
# check both the activity itself and it's page context
return sm.checkPermission(
'View', aq_inner(activity.context)) \
and sm.checkPermission(
'View',
aq_inner(activity.context).__parent__.__parent__)
- else:
+ elif activity.is_content:
return sm.checkPermission('View',
aq_inner(activity.context))
View
2 plonesocial/activitystream/browser/templates/manageportlets.pt
@@ -9,7 +9,7 @@
<div metal:fill-slot="main">
<h1 class="documentFirstHeading"
i18n:translate="manage_activitystream_portlets">Manage Activitystream Portlets</h1>
- <span tal:replace="structure provider:plonesocial.activitystream.portlets" />
+ <span tal:replace="structure provider:plonesocial.activitystream.portletmanager" />
</div>
</body>
</html>

0 comments on commit fb9fc77

Please sign in to comment.