--- CalendarPlugin.pm 2008-04-21 11:22:11.000000000 +0100 +++ /var/www/twiki42/lib/TWiki/Plugins/CalendarPlugin.pm 2008-04-18 16:52:50.000000000 +0100 @@ -69,6 +69,8 @@ $libsError = 0; $defaultsInitialized = 0; %defaults = (); +$permissionFlag=0; +#$user =''; # ========================= sub initPlugin @@ -158,12 +160,19 @@ { my( $theWeb, $theTopic ) = @_; my $text = ''; - if( $TWiki::Plugins::VERSION >= 1.010 ) { - $text = &TWiki::Func::readTopicText( $theWeb, $theTopic, '', 1 ); - } else { - $text = &TWiki::Func::readTopic( $theWeb, $theTopic ); + + if ( &TWiki::Func::checkAccessPermission( 'VIEW', $user, undef, $theTopic, $theWeb) ){ + if( $TWiki::Plugins::VERSION >= 1.010 ) { + $text = &TWiki::Func::readTopicText( $theWeb, $theTopic, '', 1 ); + } else { + $text = &TWiki::Func::readTopic( $theWeb, $theTopic ); + } + # return raw topic text, including meta data + } + else{ + $permissionFlag=1; + return false; } - # return raw topic text, including meta data return $text; } @@ -900,7 +909,11 @@ $numDays--; } } - + + #Add text to say if there's been a permissions violation + if ($permissionFlag!=0){ + $result.= "\n\n * %RED% Warning, some topics could not be included into the Calendar %ENDCOLOR%"; + } # Advance to next month in preparation for possibly # constructing another calendar