From a36c4c7147effbc43f9a2fb21db9dd4be56cf5ff Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Mon, 6 May 2024 14:31:48 +0200 Subject: [PATCH] Do not show clipboard entries if permissions are missing --- .../action/UserClipboardAction.class.php | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) 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); + } } -- 2.20.1