Esempio n. 1
0
    def check_thread_permissions(self, request, thread):
        add_acl(request.user, thread.forum)
        add_acl(request.user, thread)

        participants.make_thread_participants_aware(request.user, thread)

        allow_see_private_thread(request.user, thread)
        allow_use_private_threads(request.user)
    def check_thread_permissions(self, request, thread):
        add_acl(request.user, thread.forum)
        add_acl(request.user, thread)

        self.fetch_thread_participants(request.user, thread)

        allow_see_private_thread(request.user, thread)
        allow_use_private_threads(request.user)
Esempio n. 3
0
    def check_post_permissions(self, request, post):
        add_acl(request.user, post.forum)
        add_acl(request.user, post.thread)
        add_acl(request.user, post)

        self.fetch_thread_participants(request.user, post.thread)

        allow_see_private_post(request.user, post)
        allow_see_private_thread(request.user, post.thread)
        allow_use_private_threads(request.user)
Esempio n. 4
0
    def check_post_permissions(self, request, post):
        add_acl(request.user, post.forum)
        add_acl(request.user, post.thread)
        add_acl(request.user, post)

        participants.make_thread_participants_aware(request.user, thread)

        allow_see_private_post(request.user, post)
        allow_see_private_thread(request.user, post.thread)
        allow_use_private_threads(request.user)
Esempio n. 5
0
    def get_thread(self, request, pk, slug=None):
        allow_use_private_threads(request.user)

        thread = get_object_or_404(
            Thread.objects.select_related(*BASE_RELATIONS),
            pk=pk,
            category__tree_id=trees_map.get_tree_id_for_root(PRIVATE_THREADS_ROOT_NAME),
        )

        make_participants_aware(request.user, thread)
        allow_see_private_thread(request.user, thread)

        if slug:
            validate_slug(thread, slug)

        return thread