Description
In wikiconfig.py you can exclude actions py actions_excluded = ['RenamePage', 'AttachFile', 'DeletePage'] etc. This works fine. But if you want to exclude other actions like 'info' 'revert' etc., this does also work but causes the system to stop with an error and offering some debugging information to the user. However if you have a ModernCmsTheme you may also want to exclude these actions to unknown users, see ModernCmsTheme for more on that.
Steps to reproduce
Add actions_excluded = ['info', 'AttachFile'] to your wikiconfig.py file
Try now to call AttachFile. This is handled fine. A normal message box is displayed that you are not allowed to call this action
- Try now to call info. The wiki stops with an error and offers some debugging info.
Example
Details
MoinMoin Version |
Desktop 1.5.5a-1 |
OS and Version |
|
Python Version |
|
Server Setup |
|
Server Details |
|
Language you are using the wiki in (set in the browser/UserPreferences) |
|
Workaround
1 --- request_old.py 2006-10-15 15:20:00.000000000 +0200
2 +++ request.py 2006-12-03 19:03:08.000000000 +0100
3 @@ -1148,7 +1148,15 @@
4 else:
5 from MoinMoin.wikiaction import getHandler
6 handler = getHandler(self, action)
7 - handler(self.page.page_name, self)
8 + if handler == None:
9 + # Send page with error
10 + msg = _("You are not allowed to do %s on this page.") % wikiutil.escape(action)
11 + if not self.user.valid:
12 + # Suggest non valid user to login
13 + msg += " " + _("Login and try again.", formatted=0)
14 + self.page.send_page(self, msg=msg)
15 + else:
16 + handler(self.page.page_name, self)
17
18 # generate page footer (actions that do not want this footer use
19 # raise util.MoinMoinNoFooter to break out of the default execution
Discussion
Plan
- Priority:
- Assigned to:
- Status: patch committed to 1.5 branch (was already fixed in 1.6)