Skip to content

Commit

Permalink
fix(core): 馃悰 check for read access before attaching manifest
Browse files Browse the repository at this point in the history
Since the manifest is generated by the MW API, users lacking read access
would not be able to access the manifest.

Closes: #747
  • Loading branch information
alistair3149 committed Dec 13, 2023
1 parent b134fbf commit 0da7d8f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions includes/Partials/Metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@ public function addMetadata() {
}

/**
* Adds the manifest if enabled in 'CitizenEnableManifest'.
* Adds the manifest if:
* * Enabled in 'CitizenEnableManifest'
* * User has read access (i.e. not a private wiki)
* Manifest link will be empty if wfExpandUrl throws an exception.
*/
private function addManifest() {
if ( $this->getConfigValue( 'CitizenEnableManifest' ) !== true ) {
if (
$this->getConfigValue( 'CitizenEnableManifest' ) !== true ||
$this->getConfigValue( 'GroupPermissions' )['*']['read'] !== true
) {
return;
}

Expand Down

0 comments on commit 0da7d8f

Please sign in to comment.