From: Cyperghost Date: Fri, 22 Mar 2024 10:59:49 +0000 (+0100) Subject: Add `$user` parameter to `isAccessible` function in `Page` X-Git-Tag: 6.1.0_Alpha_1~142^2~12 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d238ca420329eaaa822a99092e50b1dca1628209;p=GitHub%2FWoltLab%2FWCF.git Add `$user` parameter to `isAccessible` function in `Page` --- 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;