Пример #1
0
def _get_extra_page_permissions(request):
    """
    Returns a list of Page-IDs that this user has authority
    to edit based on claim-<page-id> cookies set by going
    to jotleaf.com/new while unauthenticated.
    """
    from main import claiming
    return claiming.get_request_claimable_page_ids(request)
Пример #2
0
def get_claimable_pages(request):
    if not request.user.is_authenticated():
        return []
    page_ids = claiming.get_request_claimable_page_ids(request)
    if not page_ids:
        return []
    # Note: we may have already claimed some of the pages we have tokens for, so len(page_ids) might not == len(pages)
    return Page.objects.filter(id__in=page_ids, owner__isnull=True)