From 0bcdc367a51171099b7cfd49b27bba1d55d1a654 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 22 Feb 2020 16:54:47 +0100 Subject: [PATCH] Respect access to own media only when searching media --- wcfsetup/install/files/lib/data/media/MediaAction.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wcfsetup/install/files/lib/data/media/MediaAction.class.php b/wcfsetup/install/files/lib/data/media/MediaAction.class.php index 7cc233e20b..a604afa130 100644 --- a/wcfsetup/install/files/lib/data/media/MediaAction.class.php +++ b/wcfsetup/install/files/lib/data/media/MediaAction.class.php @@ -494,6 +494,9 @@ class MediaAction extends AbstractDatabaseObjectAction implements ISearchAction, public function getSearchResultList() { $mediaList = new MediaList(); $mediaList->addSearchConditions($this->parameters['searchString']); + if (WCF::getSession()->getPermission('admin.content.cms.canOnlyAccessOwnMedia')) { + $mediaList->getConditionBuilder()->add('media.userID = ?', [WCF::getUser()->userID]); + } if ($this->parameters['imagesOnly']) { $mediaList->getConditionBuilder()->add('media.isImage = ?', [1]); } -- 2.20.1