我正在尝试使用 MoinMoin 以编程方式创建一个新的 wiki 页面。但它不允许我编辑页面,我如何为用户提供创建此页面的方式?
[Fri Mar 11 11:44:35] [root]@[dev] /usr/local/share/moin
# python2.6
Python 2.6.5 (r265:79063, Jun 4 2010, 21:43:07)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from MoinMoin.web.contexts import ScriptContext
>>> from MoinMoin.PageEditor import PageEditor
>>> request = ScriptContext('http://wiki.dev.itaas.com')
>>> pe = PageEditor(request, 'MyNewTestPage')
>>> pe.saveText('Hello World!', 0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/site-packages/MoinMoin/PageEditor.py", line 1068, in saveText
raise self.AccessDenied, msg
MoinMoin.PageEditor.AccessDenied: You are not allowed to edit this page!
User
在对象上设置 a 后request
,它会创建页面,但随后会锁定整个 wiki 实例,无法创建或编辑并保存任何有401 Unauthorized
错误的新页面。