The PermittedPageFilter is a PageFilter that blocks access to all but a predefined set of pages. The permitted pages are defined on a wiki page called "PermittedPages", the error page the contents of the wiki page named "Forbidden".

If the "PermittedPages" page does not exist this filter does nothing, passing the content through with no change in behaviour. If the Forbidden page does not exist a generic 403-style XHTML error message is returned.

So that the list of permitted pages doesn't have to be compiled upon each page request, the list is cached on periodic intervals. The interval is determined by a variable that can be set from a property.

The properties are passed in via filters.xml. A filters.xml example providing sample values is attached.

Please note that this plugin is unfinished and does not work yet. This page is just the beginnings of its documentation, to be filled in as things develop. -- MurrayAltheim, 19 July 2007

Overriding the Defaults via filters.xml Parameters

The default values can be altered by passing the following (optional) parameters from the filters.xml file:
  • jspwiki.permitted.page.enable: if "false" disables the filter (default is true)
  • jspwiki.permitted.page.list: the page name of the permitted page list
  • jspwiki.permitted.page.forbidden: the page name of the forbidden message
  • jspwiki.permitted.page.refresh: the refresh value in milliseconds
  • jspwiki.permitted.page.permit.front: if "true" permits unfiltered access to the front (Main) page
  • jspwiki.permitted.page.403.message: the contents of the returned error message (in wiki text)

Bugs

Currently, I'm having difficulty getting the filter to correctly process some of the incoming content of the composed page. The screenshot shows that the filter is erroneously catching parts of Favorites.jsp. The only error message that should show up is the one in the center, since OneMinuteWiki is not on the permitted page list in the prototype.

Discussion

...


ContributedFilter

Add new attachment

In order to upload a new attachment to this page, please use the following box to find the file, then click on “Upload”.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
gz
PermittedPageFilter-20070719.t... 3.3 kB 1 19-Jul-2007 15:08 MurrayAltheim NOTE: does not work yet
xml
filters.xml 0.7 kB 1 19-Jul-2007 14:53 MurrayAltheim sample filters.xml
png
screenshot.png 87.4 kB 1 19-Jul-2007 14:57 MurrayAltheim screenshot showing problem
« This page (revision-5) was last changed on 27-Sep-2007 10:46 by JanneJalkanen [RSS]