API: Migrate Title::userCan() calls to PermissionManager
[lhc/web/wiklou.git] / includes / api / ApiUndelete.php
index 5f9b97c..ba9be81 100644 (file)
@@ -41,7 +41,7 @@ class ApiUndelete extends ApiBase {
                        $this->dieWithError( [ 'apierror-invalidtitle', wfEscapeWikiText( $params['title'] ) ] );
                }
 
-               if ( !$titleObj->userCan( 'undelete', $user, 'secure' ) ) {
+               if ( !$this->getPermissionManager()->userCan( 'undelete', $this->getUser(), $titleObj ) ) {
                        $this->dieWithError( 'permdenied-undelete' );
                }