wiki: Ensure people who are added to approved wiki may edit.

This commit is contained in:
Andre D
2012-12-11 22:22:21 -05:00
committed by Neil Williams
parent a2c5f143e1
commit ff3632482f

View File

@@ -96,16 +96,6 @@ def may_revise(sr, user, page=None):
# If the user is an editor on the page, they may edit
return True
if sr.wikimode != 'anyone':
# If the user is not a page editor and the mode is not everyone,
# the user may not edit.
return False
if not sr.can_submit(user):
# If the user can not submit to the subreddit
# They should not be able to contribute
return False
if page and page.special:
# If this is a special page
# (and the user is not a mod or page editor)
@@ -121,6 +111,17 @@ def may_revise(sr, user, page=None):
# If the user is a wiki contributor, they may revise
return True
if sr.wikimode != 'anyone':
# If the user is not a page editor or wiki contributor,
# and the mode is not everyone,
# the user may not edit.
return False
if not sr.can_submit(user):
# If the user can not submit to the subreddit
# They should not be able to contribute
return False
karma = max(user.karma('link', sr), user.karma('comment', sr))
if karma < (sr.wiki_edit_karma or 0):
# If the user has too few karma, they should not contribute