Last modified: 2014-06-24 03:46:15 UTC
In compat, page.Save can be passed sysop=True to force a sysop edit; in core, the edit just errors out: "pywikibot.exceptions.PageNotSaved: [[MediaWiki:Gadget-false-blue-links.js]]: protectednamespace-interface: You're not allowed to edit interface messages"
It doesn't work because of "@must_be(group='user')" on top of Site.editpage(). Should I create a new function like Site.editpage_sysop()? Or should I remove "@must_be(group='user')"?
By the way, here is my workaround. It's ugly, though # In APISite def performAsSysop(self, user) self.logout() self._username[False] = user self.login(False)
I think we should adapt the must_be decorator to take a new runtime parameter (e.g. as_group), which would override the group defined by the original function. (this would adapt kwargs inside must_be.decorator.callee)
I think that new parameter would not be necessary. If we call some functions whose group='user' and there is the parameter sysop=True, obviously we want to call that function as sysop but in user manner (like editing).
Change 111943 had a related patch set uploaded by Nullzero: Support editing as a sysop https://gerrit.wikimedia.org/r/111943
Change 111943 merged by jenkins-bot: Support editing as a sysop https://gerrit.wikimedia.org/r/111943
How to change the status to RESOLVED FIXED?
There should be a selection box below the comment box ('Status: [PATCH_TO_REVIEW v]'). If not, ask Andre (aklapper@wikimedia.org) for 'editbugs' rights. However, I'm keeping this open, as def save should either get a working 'sysop=...' parameter or a @deprecated('sysop', 'as_group="sysop"') decorator.
Change 112299 had a related patch set uploaded by Nullzero: Switch sysop parameter to as_group='sysop' https://gerrit.wikimedia.org/r/112299
Change 112299 merged by jenkins-bot: Mark sysop parameter as deprecated https://gerrit.wikimedia.org/r/112299