/** * Checks that the user has permissions to perform this upload. * Dies with usage message on inadequate permissions. * @param User $user The user to check. */ protected function checkPermissions($user) { // Check whether the user has the appropriate permissions to upload anyway $permission = $this->mUpload->isAllowed($user); if ($permission !== true) { if (!$user->isLoggedIn()) { $this->dieUsageMsg(array('mustbeloggedin', 'upload')); } $this->dieUsageMsg('badaccess-groups'); } }
/** * Checks that the user has permissions to perform this upload. * Dies with usage message on inadequate permissions. * @param User $user The user to check. */ protected function checkPermissions($user) { // Check whether the user has the appropriate permissions to upload anyway $permission = $this->mUpload->isAllowed($user); if ($permission !== true) { if (!$user->isLoggedIn()) { $this->dieUsageMsg(['mustbeloggedin', 'upload']); } $this->dieUsageMsg('badaccess-groups'); } // Check blocks if ($user->isBlocked()) { $this->dieBlocked($user->getBlock()); } // Global blocks if ($user->isBlockedGlobally()) { $this->dieBlocked($user->getGlobalBlock()); } }