Stanislav Panasik avatar Stanislav Panasik committed e74e407

Removed checks for topic permissions. Now only forum permissions are checked.

Comments (0)

Files changed (1)

     except Topic.DoesNotExist:
         raise Http404()
-    if (not request.user.is_superuser) and (have_permissions(request, forum, 'deny-view-forum') or \
-       have_permissions(request, topic, 'deny-view-topic')):
-        # user cannot view this topic
+    if (not request.user.is_superuser) and have_permissions(request, forum, 'deny-view-forum'):
+        # user cannot view this topic because cannot view this forum
         return HttpResponseRedirect('/')
     topic.views += 1
 def show_post(request, post_id):
     post = get_object_or_404(Post, pk=post_id)
-    if (not request.user.is_superuser) and (have_permissions(request,, 'deny-view-forum') or \
-       have_permissions(request, post.topic, 'deny-view-topic')):
+    if (not request.user.is_superuser) and have_permissions(request,, 'deny-view-forum'):
         return HttpResponseRedirect('/')
     count = post.topic.posts.filter(created__lt=post.created).count() + 1
     page = math.ceil(count / float(settings.PYBB_TOPIC_PAGE_SIZE))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.