From d238ca420329eaaa822a99092e50b1dca1628209 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Fri, 22 Mar 2024 11:59:49 +0100 Subject: [PATCH] Add `$user` parameter to `isAccessible` function in `Page` --- wcfsetup/install/files/lib/data/page/Page.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/data/page/Page.class.php b/wcfsetup/install/files/lib/data/page/Page.class.php index ed4575d243..347d1e1040 100644 --- a/wcfsetup/install/files/lib/data/page/Page.class.php +++ b/wcfsetup/install/files/lib/data/page/Page.class.php @@ -9,6 +9,7 @@ use wcf\data\ITitledObject; use wcf\data\page\content\PageContent; use wcf\data\TDatabaseObjectOptions; use wcf\data\TDatabaseObjectPermissions; +use wcf\data\user\User; use wcf\system\acl\simple\SimpleAclResolver; use wcf\system\application\ApplicationHandler; use wcf\system\cache\builder\ApplicationCacheBuilder; @@ -263,9 +264,9 @@ class Page extends DatabaseObject implements ILinkableObject, ITitledObject * * @return bool */ - public function isAccessible() + public function isAccessible(?User $user = null) { - $canAccess = SimpleAclResolver::getInstance()->canAccess('com.woltlab.wcf.page', $this->pageID); + $canAccess = SimpleAclResolver::getInstance()->canAccess('com.woltlab.wcf.page', $this->pageID, $user); if ($this->invertPermissions) { $canAccess = !$canAccess; -- 2.20.1