Index: view_unpublished.module
===================================================================
--- view_unpublished.module
+++ view_unpublished.module
@@ -118,23 +118,70 @@
 function view_unpublished_query_alter($query) {
   global $user;
   if (arg(0) == 'admin' && arg(1) == 'content' && get_class($query) == 'TableSort'
-      && $user->uid !== "1" && !user_access('bypass node access') && !user_access('administer nodes')) {
+      && $user->uid !== "1" && !user_access('bypass node access')) {
     $perms = view_unpublished_user_perms();
+
+    // Fetch the nids of the user's own unpublished nodes if he is allowed to
+    // view those. This is the same query as in node_admin_nodes(), we need it
+    // to remove the condition which restricts the unpublished nodes to the
+    // user's own ones.
+    $own_unpublished_nids = array();
+    if (user_access('view own unpublished content')) {
+      $own_unpublished_nids = db_query('
+        SELECT nid
+        FROM {node}
+        WHERE uid = :uid AND status = :status',
+        array(':uid' => $GLOBALS['user']->uid, ':status' => 0))->fetchCol();
+    }
+
     // "any" in this case means at least 1 view unpublished permission is set to TRUE.
     if ($perms['any']) {
       $conditions =& $query->conditions();
+
+      // Configuration of a condition in $conditions to only list published
+      // nodes.
+      $published_condition = array(
+        'field' => 'n.status',
+        'value' => 1,
+        'operator' => '=',
+      );
+
       foreach ($conditions as $key => $condition) {
-        // For some queries $condition['field'] is not a string so we need a check for that.
-        if (isset($condition['field']) && $condition['field'] === 'n.status') {
-          if (TRUE) {
-            if ($key == count($conditions) - 2) {
-              // This condition is (probably) coming from modules/node/node.admin.inc,
-              // function node_admin_nodes():       $query->condition('n.status', 1);
-              // We don't want it.
-              unset($conditions[$key]);
-            }
+        // If there are no own unpublished nodes to be shown ...
+        if (!$own_unpublished_nids) {
+          // Has the user a filter set to only list published nodes?
+          $filter_published_only = !empty($_SESSION['node_overview_filter'])
+            && in_array(array('status', 'status-1'),
+            $_SESSION['node_overview_filter']);
+
+          // ... then we only need to remove the condition restricting the nodes
+          // to published ones (set in node_admin_nodes() in
+          // modules/node/node.admin.inc) if the user has not set a filter to
+          // list published nodes only.
+          if ($condition == $published_condition && !$filter_published_only) {
+            unset($conditions[$key]);
           }
         }
+        // If the user has unpublished nodes he is allowed to view and this
+        // condition might be the one we want to remove.
+        elseif (isset($condition['field']) && is_object($condition['field'])) {
+          // Configuration of the condition which adds the users own unpublished
+          // nodes to the result set as set in node_admin_nodes().
+          $own_unpublished_condition = array(
+            '#conjunction' => 'OR',
+            0 => $published_condition,
+            1 => array(
+              'field' => 'n.nid',
+              'value' => $own_unpublished_nids,
+              'operator' => 'IN',
+            ),
+          );
+
+          // Remove the condition if it's the one we're looking for.
+          if ($condition['field']->conditions() == $own_unpublished_condition) {
+            unset($conditions[$key]);
+          }
+        }
       }
       // If "view any unpublished content" (aka $perms['full']) is set, then
       // leave the rest of the query as-is and return all unpublished content.
