Redo WhatLinksHere query and add a *_from_namespace field to link tables
[lhc/web/wiklou.git] / includes / logging / LogEventsList.php
index 4ce8070..c88af04 100644 (file)
@@ -437,20 +437,19 @@ class LogEventsList extends ContextSource {
         */
        public static function userCanBitfield( $bitfield, $field, User $user = null ) {
                if ( $bitfield & $field ) {
-                       if ( $bitfield & LogPage::DELETED_RESTRICTED ) {
-                               $permission = 'suppressrevision';
-                       } else {
-                               $permission = 'deletedhistory';
-                       }
-                       wfDebug( "Checking for $permission due to $field match on $bitfield\n" );
                        if ( $user === null ) {
                                global $wgUser;
                                $user = $wgUser;
                        }
-
-                       return $user->isAllowed( $permission );
+                       if ( $bitfield & LogPage::DELETED_RESTRICTED ) {
+                               $permissions = array( 'suppressrevision', 'viewsuppressed' );
+                       } else {
+                               $permissions = array( 'deletedhistory' );
+                       }
+                       $permissionlist = implode( ', ', $permissions );
+                       wfDebug( "Checking for $permissionlist due to $field match on $bitfield\n" );
+                       return call_user_func_array( array( $user, 'isAllowedAny' ), $permissions );
                }
-
                return true;
        }