From: Marcel Werk Date: Mon, 6 May 2024 12:31:48 +0000 (+0200) Subject: Do not show clipboard entries if permissions are missing X-Git-Tag: 6.0.14_dev_1~10^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a36c4c7147effbc43f9a2fb21db9dd4be56cf5ff;p=GitHub%2FWoltLab%2FWCF.git Do not show clipboard entries if permissions are missing --- diff --git a/wcfsetup/install/files/lib/system/clipboard/action/UserClipboardAction.class.php b/wcfsetup/install/files/lib/system/clipboard/action/UserClipboardAction.class.php index 59b1f67f0e..6e63ed1c24 100644 --- a/wcfsetup/install/files/lib/system/clipboard/action/UserClipboardAction.class.php +++ b/wcfsetup/install/files/lib/system/clipboard/action/UserClipboardAction.class.php @@ -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); + } }