Validate if an article may be edited in `setCategory` clipboard action
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 28 Mar 2023 12:41:54 +0000 (14:41 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 18 Apr 2023 07:42:01 +0000 (09:42 +0200)
wcfsetup/install/files/lib/system/clipboard/action/ArticleClipboardAction.class.php

index be1650447f14114c34f9de0ef961cd7bc1487bda..4502f6f5237e89554f1212759adc8e53a8c6162c 100644 (file)
@@ -142,7 +142,16 @@ class ArticleClipboardAction extends AbstractClipboardAction {
                        return [];
                }
                
-               return array_keys($this->objects);
+               $objectIDs = [];
+               
+               /** @var Article $article */
+               foreach ($this->objects as $article) {
+                       if ($article->canEdit()) {
+                               $objectIDs[] = $article->articleID;
+                       }
+               }
+               
+               return $objectIDs;
        }
        
        /**