diff --git a/includes/RequestWiki/Handler/RestWikiRequest.php b/includes/RequestWiki/Handler/RestWikiRequest.php index b51e300e3..f9184b595 100644 --- a/includes/RequestWiki/Handler/RestWikiRequest.php +++ b/includes/RequestWiki/Handler/RestWikiRequest.php @@ -60,9 +60,19 @@ public function run( $id ) { ); if ( $wikiRequest ) { $wikiRequestVisibility = $visibilityConds[$wikiRequest->cw_visibility]; - if ( !$this->getAuthority()->isAllowed( $wikiRequestVisibility ) ) { - // User does not have permission to view this wiki request - return $this->getResponseFactory()->createHttpError( 404, ['message' => 'Request not found'] ); + + /* + * CreateWiki is enabled globally on all wikis in the farm. + * + * Require both (createwiki) and the required permission to prevent suppressed requests from + * being revealed to local suppressors/sysops + */ + + if ( $wikiRequestVisibility !== 'read' ) { + if ( !$this->getAuthority()->isAllowedAll( 'createwiki', $wikiRequestVisibility ) ) { + // User does not have permission to view this request + return $this->getResponseFactory()->createHttpError( 404, ['message' => 'Request not found'] ); + } } $response = [ 'comment' => $wikiRequest->cw_comment,