def process_request(self, request):
        slug = request.path
        if slug != '/':
            slug = slug.strip('/')
        if slug == '':
            return None
        page_or_none = Page.objects.filter(slug=slug)
        if page_or_none.exists():
            page = page_or_none[0]
            try:
                content = page.get_content_model()
                if hasattr(content, 'can_view'):
                    if content.can_view(request):
                        return None
                    else:
                        raise ex.PermissionDenied('User does not have permission to view')
            except __HOLE__:
                return None
            except KeyError:
                return None
dataset/ETHPy150Open hydroshare/hydroshare2/ga_resources/middleware.py/PagePermissionsViewableMiddleware.process_request