internal package
Foswiki::Plugins::FilesysVirtualPlugin The following implementation is required if we decide to use cached permissions
use Foswiki::Plugins::FilesysVirtualPlugin::Permissions ();my $pluginName = 'FilesysVirtualPlugin';
sub initPlugin { my ( $topic, $web, $user, $installWeb ) = @_;
my $pdb = $Foswiki::cfg{Plugins}{FilesysVirtualPlugin}{PermissionsDB};
if ($pdb) { eval 'use Foswiki::Plugins::FilesysVirtualPlugin::Permissions'; if ( $@ ) { Foswiki::Func::writeWarning( $@ ); print STDERR $@; # print to webserver log file } else { $permDB = new Foswiki::Plugins::FilesysVirtualPlugin::Permissions( $pdb ); } } else { my $mess = "{Plugins}{FilesysVirtualPlugin}{PermissionsDB} is not defined"; Foswiki::Func::writeWarning($mess); print STDERR "$mess\n"; return 0; } unless( $permDB ) { my $mess = "$pluginName: failed to initialise"; Foswiki::Func::writeWarning( $mess ); print STDERR "$mess\n"; return 0; }return 1; }
sub beforeSaveHandler { my ( $text, $topic, $web ) = @_;
return unless( $permDB );
eval { $permDB→processText( $web, $topic, $text ); };
if ( $@ ) { Foswiki::Func::writeWarning( "$pluginName: $@" ); print STDERR "$pluginName: $@\n"; } }