- /**
- * Checks that the user has permissions to perform this revert.
- * Dies with usage message on inadequate permissions.
- * @param User $user The user to check.
- */
- protected function checkPermissions( $user ) {
- $title = $this->file->getTitle();
- $permissionErrors = array_merge(
- $title->getUserPermissionsErrors( 'edit', $user ),
- $title->getUserPermissionsErrors( 'upload', $user )
- );
-
- if ( $permissionErrors ) {
- $this->dieUsageMsg( $permissionErrors[0] );
- }
- }
-