Changeset 1115


Ignore:
Timestamp:
12/01/08 12:01:08 (3 years ago)
Author:
CrawfordCurrie
Message:

Item42: protect REVINFO from footpads

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/UnitTestContrib/test/unit/Fn_REVINFO.pm

    r816 r1115  
    194194} 
    195195 
     196sub test_42 { 
     197    my $this = shift; 
     198    $this->{twiki}->{store}->saveTopic( 
     199        $this->{test_user_cuid}, 
     200        $this->{test_web}, "HappyPill", 
     201        "   * Set ALLOWTOPICVIEW = CarlosCastenada\n"); 
     202    $this->{twiki}->finish(); 
     203    $this->{twiki} = new Foswiki(); 
     204    my $ui = $this->{twiki}->handleCommonTags( 
     205        '%REVINFO{topic="'.$this->{test_web}.'.HappyPill" format="$username $wikiname $wikiusername"}%', 
     206        $this->{test_web}, 'GlumDrop'); 
     207    $this->assert($ui =~ /No permission to view/); 
     208} 
     209 
    196210# SMELL: need to test for other revs specified by the 'rev' parameter 
    197211 
  • trunk/core/lib/Foswiki.pm

    r1090 r1115  
    36253625    my $rev = $params->{rev} || $cgiRev || ''; 
    36263626 
     3627    ( $web, $topic ) = $this->normalizeWebTopicName( $web, $topic ); 
     3628    if ($web ne $theWeb || $topic ne $theTopic) { 
     3629        unless ( 
     3630            $this->security->checkAccessPermission( 
     3631                'VIEW', $this->{user}, undef, undef, $topic, $web 
     3632            ) 
     3633          ) 
     3634        { 
     3635            return $this->inlineAlert( 'alerts', 'access_denied', $web, 
     3636                $topic ); 
     3637        } 
     3638    } 
     3639 
    36273640    return $this->renderer->renderRevisionInfo( $web, $topic, undef, $rev, 
    36283641        $format ); 
Note: See TracChangeset for help on using the changeset viewer.