Merge "ChangesListSpecialPage: Implement two new hooks superseding 4 old ones"
[lhc/web/wiklou.git] / includes / api / ApiQueryBase.php
index 32a03f1..9d9f7c3 100644 (file)
@@ -501,6 +501,7 @@ abstract class ApiQueryBase extends ApiBase {
                        // prefix.
                        $this->dieUsageMsg( array( 'invalidtitle', $titlePart ) );
                }
+
                return substr( $t->getDbKey(), 0, -1 );
        }
 
@@ -608,6 +609,15 @@ abstract class ApiQueryBase extends ApiBase {
 
                return $errors;
        }
+
+       /**
+        * Check whether the current user has permission to view revision-deleted
+        * fields.
+        * @return bool
+        */
+       public function userCanSeeRevDel() {
+               return $this->getUser()->isAllowedAny( 'deletedhistory', 'deletedtext', 'suppressrevision' );
+       }
 }
 
 /**