Skip to content

Commit

Permalink
Item13897: Odd elements in hash for Raw / History Access exceptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
gac410 committed Aug 13, 2016
1 parent 741f73c commit 5ef4f45
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions core/lib/Foswiki/UI/View.pm
Expand Up @@ -145,9 +145,13 @@ sub view {
{

if ( $Foswiki::cfg{FeatureAccess}{AllowRaw} eq 'authenticated' ) {
throw Foswiki::AccessControlException( 'authenticated',
$app->user, $web, $topic, $Foswiki::Meta::reason )
unless $app->inContext("authenticated");
Foswiki::AccessControlException->throw(
mode => 'raw',
user => $app->user,
web => $web,
topic => $topic,
reason => 'Authentication required'
) unless $app->inContext("authenticated");
}
else {
$this->checkAccess( 'RAW', $topicObject )
Expand All @@ -163,9 +167,13 @@ sub view {

if ( $Foswiki::cfg{FeatureAccess}{AllowHistory} eq 'authenticated' )
{
throw Foswiki::AccessControlException( 'authenticated',
$app->user, $web, $topic, $Foswiki::Meta::reason )
unless $app->inContext("authenticated");
Foswiki::AccessControlException->throw(
mode => 'history',
user => $app->user,
web => $web,
topic => $topic,
reason => 'Authentication required'
) unless $app->inContext("authenticated");
}
else {
$this->checkAccess( 'HISTORY', $topicObject );
Expand Down Expand Up @@ -198,8 +206,13 @@ sub view {
$topicObject =
Foswiki::Meta->load( $app, $web, $topic, $showRev );
if ( !$topicObject->haveAccess('VIEW') ) {
throw Foswiki::AccessControlException( 'VIEW',
$app->user, $web, $topic, $Foswiki::Meta::reason );
Foswiki::AccessControlException->throw(
mode => 'VIEW',
user => $app->user,
web => $web,
topic => $topic,
reason => $topicObject->reason
);
}
$logEntry .= 'r' . $requestedRev;
}
Expand Down

0 comments on commit 5ef4f45

Please sign in to comment.