This is actually a limitation of the Func API: you can't use
to generate an
as this needs an extra
def => 'topic_access'
parameter. And this is not part of the calling interface. So infact anything in
can't be called by a
Admitted, you are supposed to throw an access denied exception instead of creating a redirect of its own. But the current
script does not catch exceptions and thus generates an internal server error if you throw an exception.
So there are three ways to fix this all:
- enhance the Func API to allow a
- i think this is the appropriate long term solution - CC
- catch exceptions in the
rest script and redirect to the appropriate oops url from in there
- This is not an option, as REST code is not UI code. there is no guarantee that a REST handler will terminate with a redirect or page display. For example, an XmlHttpRequest really doesn't want to get answered with a redirect. - CC
- you could still
try ... catch exceptions in order to prevent an internal server error message and generate some sort of return message that can be processed by the caller - MD
- bypass the Func API in the EditRowPlugin rest handler
- This is a stop-gap at best. - CC
I went with (3) for now.
- 16 Mar 2007
As described above, the bug is in the Func API which doesn't give access to the whole functionality of getOopsUrl.
Bigger job than i anticipated, but it's a bit cleaner now and I was able to delete another function from TWiki.pm
Part of SVN 13287 was a deprecation of a Func API function.
How can a official API be deprecated without a release meeting decision?
This is not the first time this is pointed out. I am not saying I am against but people should have a chance to evaluate and make a qualified decision.
The following plugins are affected by the deprecation
- 07 Apr 2007
The solution is to deprecate
instead. Documented, deprecated the
function and added unit test for the deprecated function.