41 private string $result;
53 $this->newContent = $newContent;
54 $this->title = $title;
55 $this->performer = $performer;
60 if ( $this->title->getNamespace() ===
NS_FILE &&
61 $this->newContent->isRedirect() &&
62 !$this->performer->isAllowed(
'upload' )
64 $this->result = self::CONSTRAINT_FAILED;
65 return self::CONSTRAINT_FAILED;
68 $this->result = self::CONSTRAINT_PASSED;
69 return self::CONSTRAINT_PASSED;
75 if ( $this->result === self::CONSTRAINT_FAILED ) {
76 $errorCode = $this->performer->getUser()->isRegistered() ?
77 self::AS_IMAGE_REDIRECT_LOGGED :
78 self::AS_IMAGE_REDIRECT_ANON;
79 $statusValue->
setResult(
false, $errorCode );
if(!defined('MW_SETUP_CALLBACK'))
Verify user permissions: If creating a redirect in the file namespace, must have upload rights.
__construct(Content $newContent, LinkTarget $title, Authority $performer)
getLegacyStatus()
Get the legacy status for failure (or success)
Generic operation result class Has warning/error list, boolean status and arbitrary value.
setResult( $ok, $value=null)
Change operation result.
Content objects represent page content, e.g.
Interface for all constraints that can prevent edits.