hovel/pybbm — pull request #60 by chrisv2 (2013-02-22 11:40:43+00:00)
Title: redirect anonymous user to login, if trying to access protected post

Problem: If a user gets a post notification email for protected topic or forum, clicking the link will lead to 404 response, as the user is not logged on and therefore is not allowed to see topic/forum. This is serious usability problem for us, as it confuses the user.

The patch changes the behaviour of Category, Forum, Topic and Post view, redirecting anonymous users to login page, whereas authenticated users which are not authorized get 403 (Forbidden) response.

Unfortunately this requires additional may_view_xxx methods on permission handler, but it's necessary because if you only filter post, you cannot tell whether item is not there, or just not authorized.

Tests have been updated to reflect new behaviour.