def _activity_visible(self, activity):
        if IStatusActivity.providedBy(activity) and self.show_microblog:
            return True
        elif IContentActivity.providedBy(activity) and self.show_content:
            return True
        elif IDiscussionActivity.providedBy(activity) and self.show_discussion:
            return True

        return False
    def _activity_visible(self, activity):
        if IStatusActivity.providedBy(activity) and self.show_microblog:
            return True
        elif IContentActivity.providedBy(activity) and self.show_content:
            return True
        elif IDiscussionActivity.providedBy(activity) and self.show_discussion:
            return True

        return False
 def can_view(self, activity):
     """Returns true if current user has the 'View' permission.
     """
     sm = getSecurityManager()
     if IStatusActivity.providedBy(activity):
         permission = "Plone Social: View Microblog Status Update"
         return sm.checkPermission(permission, self.context)
     elif IDiscussionActivity.providedBy(activity):
         # 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__)
     elif IContentActivity.providedBy(activity):
         return sm.checkPermission('View', aq_inner(activity.context))
 def can_view(self, activity):
     """Returns true if current user has the 'View' permission.
     """
     sm = getSecurityManager()
     if IStatusActivity.providedBy(activity):
         permission = "Plone Social: View Microblog Status Update"
         return sm.checkPermission(permission, self.context)
     elif IDiscussionActivity.providedBy(activity):
         # 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__)
     elif IContentActivity.providedBy(activity):
         return sm.checkPermission('View',
                                   aq_inner(activity.context))