31 private readonly
Content $newContent,
39 if ( $this->title->getNamespace() ===
NS_FILE &&
40 $this->newContent->isRedirect() &&
41 !$this->performer->isAllowed(
'upload' )
43 $errorCode = $this->performer->getUser()->isRegistered() ?
48 ->setErrorFunction(
static fn () =>
throw new PermissionsError(
'upload' ) );
if(!defined('MW_SETUP_CALLBACK'))
Abstract class for all constraints that can prevent edits.
Verify user permissions: If creating a redirect in the file namespace, must have upload rights.
__construct(private readonly Content $newContent, private readonly LinkTarget $title, private readonly Authority $performer,)
Status returned by edit constraints and other page editing checks.
setOK( $ok)
Change operation status.
static newGood( $value=null)
Factory function for good results.
Content objects represent page content, e.g.
const AS_IMAGE_REDIRECT_ANON
Status: anonymous user is not allowed to upload (User::isAllowed('upload') == false)
const AS_IMAGE_REDIRECT_LOGGED
Status: logged in user is not allowed to upload (User::isAllowed('upload') == false)