# Path: privagal/core/utils.py
# def check_view_restrictions(request, page):
#     """
#     Mimic default Wagtail core behaviour but throw a 403 exception instead of
#     a redirect.
# 
#     See wagtail.wagtailcore.wagtail_hooks.check_view_restrictions
#     """
#     restrictions = page.get_view_restrictions()
#     if restrictions:
#         passed_restrictions = request.session.get('passed_page_view_restrictions', [])
# 
#         for restriction in restrictions:
#             if restriction.id not in passed_restrictions:
#                 raise PermissionDenied


from django.conf import settings
from django.template.response import TemplateResponse
from wagtail.wagtailcore.models import Page
from .utils import check_view_restrictions
# -*- coding: utf-8 -*-
from __future__ import unicode_literals





class PageLoginRequiredMixin(object):

    def dispatch(self, request, *args, **kwargs):
        page = Page.objects.get(slug='timeline')

# Path: privagal/core/utils.py
# def check_view_restrictions(request, page):
#     """
#     Mimic default Wagtail core behaviour but throw a 403 exception instead of
#     a redirect.
# 
#     See wagtail.wagtailcore.wagtail_hooks.check_view_restrictions
#     """
#     restrictions = page.get_view_restrictions()
#     if restrictions:
#         passed_restrictions = request.session.get('passed_page_view_restrictions', [])
# 
#         for restriction in restrictions:
#             if restriction.id not in passed_restrictions:
#                 raise PermissionDenied


# Path: privagal/core/mixins.py
from django.conf import settings
from django.template.response import TemplateResponse
from wagtail.wagtailcore.models import Page
from .utils import check_view_restrictions

# -*- coding: utf-8 -*-
from __future__ import unicode_literals





class PageLoginRequiredMixin(object):

    def dispatch(self, request, *args, **kwargs):
        page = Page.objects.get(slug='timeline')

        check_view_restrictions(request, page)