Problem
When a user doesn't have read access to a page, they are sent to a generic error page.
There is no way to inform them on a per-web basis of the right person to contact for
gaining access to that page.
Proposal
Add a
WebPreferences variable (say WEBVIEWACCESSERROR) that specifies which page should
be shown when a user doesn't have access to view a page. That page could describe
who is allowed to see the page and who to contact to gain access.
I've modified bin/viewauth as follows:
if( ! $viewAccessOK ) {
my $url = &TWiki::getOopsUrl( $webName, $topic, "oopsaccessview" );
+ my $errorTopic = TWiki::Prefs::getPreferencesValue( "WEBVIEWACCESSERROR", $webName ) || "";
+ if ($errorTopic ne "") {
+ my ($errweb, $errtopic) = split(/\./, $errorTopic);
+ if ($errtopic ne "" && $errweb ne $webName) {
+ $url = &TWiki::getViewUrl( $errweb, $errtopic );
+ }
+ }
TWiki::redirect( $query, $url );
return;
}
Obviously this could be extended to handle write access errors as well, but we were
having problems mostly with reads. This allows different webs to manage access control
independently. We typically point WEBVIEWACCESSERROR at the same Main.XxxGroup page
which controls access to the web. It explains the rules for who can access the web
and who to contact to gain access, as well as the actual access control GROUP list.
--
MikeSalisbury - 14 Sep 2004