Do not show clipboard entries if permissions are missing
authorMarcel Werk <burntime@woltlab.com>
Mon, 6 May 2024 12:31:48 +0000 (14:31 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 6 May 2024 12:31:48 +0000 (14:31 +0200)
wcfsetup/install/files/lib/system/clipboard/action/UserClipboardAction.class.php

index 59b1f67f0ea3d11d95258aa38d2587664cebf106..6e63ed1c24f1c5b7f437c002890d3cf5d1ba4b25 100644 (file)
@@ -353,4 +353,30 @@ class UserClipboardAction extends AbstractClipboardAction
 
         return $this->__validateAccessibleGroups(\array_keys($this->objects));
     }
+
+    /**
+     * @return      int[]
+     * @since       6.0
+     */
+    protected function validateSendMail(): array
+    {
+        if (!WCF::getSession()->getPermission('admin.user.canMailUser')) {
+            return [];
+        }
+
+        return \array_keys($this->objects);
+    }
+
+    /**
+     * @return      int[]
+     * @since       6.0
+     */
+    protected function validateExportMailAddress(): array
+    {
+        if (!WCF::getSession()->getPermission('admin.user.canEditMailAddress')) {
+            return [];
+        }
+
+        return \array_keys($this->objects);
+    }
 }