From c487b847e2053b13c4eea0ccfeecf5a41c396412 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 7 Jan 2008 16:34:13 -0500 Subject: * Improved the canedit hook interface, allowing a callback function to be returned (and not run in some cases) rather than the plugins directly forcing a user to log in. * opendiscussion: allow editing of the toplevel discussion page, and, indirectly, allow creating new discussion pages. --- doc/plugins/write.mdwn | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 4ff5ff59e..34caf83f6 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -246,10 +246,16 @@ a page can be edited using the web interface (commits from revision control bypass it). When a page is edited, each registered canedit hook is called in turn, and passed the page name, a CGI object, and a session object. -If edit can proceed, the hook should return "". If the edit is not allowed -by this hook, the hook should return an error message for the user to see. If the hook has no opinion about whether the edit can proceed, return -`undef`, and the next plugin will be asked to decide. +`undef`, and the next plugin will be asked to decide. If edit can proceed, +the hook should return "". If the edit is not allowed by this hook, the +hook should return an error message for the user to see, or a function +that can be run to log the user in or perform other action necessary for +them to be able to edit the page. + +This hook should avoid directly redirecting the user to a signin page, +since it's sometimes used to test to see which pages in a set of pages a +user can edit. ### editcontent -- cgit v1.2.3