Index: TWiki.pm =================================================================== --- TWiki.pm (revision 3266) +++ TWiki.pm (working copy) @@ -2118,6 +2118,18 @@ $text =~ s/%STOPINCLUDE%.*//s; } # else is a file with relative path, e.g. $dataDir/../../path/to/non-twiki/file.ext + + # handle permission denied + # FIXME: The following breaks if spec of readTopicRaw() changes + if( $text =~ /^No permission to read topic/ ) { + if( $warn || TWiki::Prefs::getPreferencesFlag( "INCLUDEWARNING" ) ) { + if ( $warn =~ /^(off|no)$/i ) { + $text = ""; + } else { + $text = "Warning: Permission denied to view/include topic."; + } + } + } $text = applyPatternToIncludedText( $text, $pattern ) if( $pattern );