changeset 1900:89fffad859b5

SpellCheck: check if user may write to request.cfg.page_local_spelling_words
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sun, 18 Mar 2007 23:19:49 +0100
parents 3d2dbe3e8a4c
children 86819d96cb01
files MoinMoin/action/SpellCheck.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/SpellCheck.py	Sun Mar 18 22:48:15 2007 +0100
+++ b/MoinMoin/action/SpellCheck.py	Sun Mar 18 23:19:49 2007 +0100
@@ -100,7 +100,6 @@
 
 def _addLocalWords(request):
     from MoinMoin.PageEditor import PageEditor
-
     # get the new words as a string (if any are marked at all)
     try:
         newwords = request.form['newwords']
@@ -209,7 +208,13 @@
 
 def execute(pagename, request):
     _ = request.getText
+
     page = Page(request, pagename)
+    if not request.user.may.write(request.cfg.page_local_spelling_words):
+        msg = _("You can't save spelling words.")
+        page.send_page(msg=msg)
+        return
+
     if request.user.may.read(pagename):
         badwords, badwords_re, msg = checkSpelling(page, request)
     else: