diff --git a/r2/r2/controllers/front.py b/r2/r2/controllers/front.py index 9de90b409..114c6f046 100755 --- a/r2/r2/controllers/front.py +++ b/r2/r2/controllers/front.py @@ -1228,7 +1228,8 @@ class FormsController(RedditController): returns their user name""" c.response_content_type = 'text/plain' if c.user_is_loggedin: - perm = str(c.user.can_wiki()) + # Change cookie based on can_wiki trac permissions + perm = str(c.user.can_wiki(default=False)) c.response.content = c.user.name + "," + perm else: c.response.content = '' diff --git a/r2/r2/controllers/validator/wiki.py b/r2/r2/controllers/validator/wiki.py index 7018bb824..62454053e 100644 --- a/r2/r2/controllers/validator/wiki.py +++ b/r2/r2/controllers/validator/wiki.py @@ -88,7 +88,7 @@ def may_revise(sr, user, page=None): # Users who are not allowed to view the page may not contribute to the page return False - if not user.can_wiki(): + if not user.can_wiki(default=True): # Global wiki contributute ban return False diff --git a/r2/r2/models/account.py b/r2/r2/models/account.py index 9cd89120a..ac8b2c69d 100644 --- a/r2/r2/models/account.py +++ b/r2/r2/models/account.py @@ -182,9 +182,11 @@ class Account(Thing): karma = self.link_karma return max(karma, 1) if karma > -1000 else karma - def can_wiki(self): + def can_wiki(self, default=False): if self.wiki_override is None: - return self.link_karma > 100 or self.comment_karma > 100 + if not default: + return self.link_karma > 100 or self.comment_karma > 100 + return default return self.wiki_override def all_karmas(self):