Add `$user` parameter to `isAccessible` function in `Page`
authorCyperghost <olaf_schmitz_1@t-online.de>
Fri, 22 Mar 2024 10:59:49 +0000 (11:59 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Fri, 22 Mar 2024 10:59:49 +0000 (11:59 +0100)
wcfsetup/install/files/lib/data/page/Page.class.php

index ed4575d243646e1036c5d085f22f13b13a9693aa..347d1e1040f639991d7154443bb018dbfa56f749 100644 (file)
@@ -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;