From 1c91e67a683a0833d8eaaa2c50f80b105aeb0bdc Mon Sep 17 00:00:00 2001 From: Andre D Date: Wed, 19 Feb 2014 16:02:19 -0500 Subject: [PATCH] about: Fix /edit and /traffic for logged out users. --- r2/r2/controllers/front.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/r2/r2/controllers/front.py b/r2/r2/controllers/front.py index c353a729d..41ba85f66 100755 --- a/r2/r2/controllers/front.py +++ b/r2/r2/controllers/front.py @@ -652,6 +652,7 @@ class FrontController(RedditController): def _edit_normal_reddit(self, location, created): if (location == 'edit' and + c.user_is_loggedin and (c.user_is_admin or c.site.is_moderator_with_perms(c.user, 'config'))): pane = PaneStack() if created == 'true': @@ -677,8 +678,10 @@ class FrontController(RedditController): stylesheet = (c.site.stylesheet_contents_user or c.site.stylesheet_contents) pane = SubredditStylesheetSource(stylesheet_contents=stylesheet) - elif location == 'traffic' and (c.site.public_traffic or - (c.site.is_moderator(c.user) or c.user.employee)): + elif (location == 'traffic' and + (c.site.public_traffic or + (c.user_is_loggedin and + (c.site.is_moderator(c.user) or c.user.employee)))): pane = trafficpages.SubredditTraffic() elif (location == "about") and is_api(): return self.redirect(add_sr('about.json'), code=301)