[Pywikipedia-svn] SVN: [7216] trunk/pywikipedia/wikipedia.py
alexsh at svn.wikimedia.org
alexsh at svn.wikimedia.org
Sun Sep 6 15:45:28 UTC 2009
Revision: 7216
Author: alexsh
Date: 2009-09-06 15:45:27 +0000 (Sun, 06 Sep 2009)
Log Message:
-----------
Page().put(): add check permission `editusercssjs` if use_api enable in edit user css and js.
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2009-09-06 15:42:59 UTC (rev 7215)
+++ trunk/pywikipedia/wikipedia.py 2009-09-06 15:45:27 UTC (rev 7216)
@@ -1402,6 +1402,9 @@
if not force:
if not self.botMayEdit(username):
raise LockedPage(u'Not allowed to edit %s because of a restricting template' % self.aslink())
+ elif config.use_api and self.namespace() in [2,3] and ( '.css' in self.title() or '.js' in self.title()):
+ # API enable: if title is .css or .js in ns2,3 , it need permission `editusercssjs`
+ sysop = self._getActionUser(action = 'editusercssjs', restriction = self.editRestriction, sysop=True)
# If there is an unchecked edit restriction, we need to load the page
if self._editrestriction:
More information about the Pywikipedia-svn
mailing list