<name>com.woltlab.wcf.page</name>
<definitionname>com.woltlab.wcf.acl.simple</definitionname>
</type>
+ <type>
+ <name>com.woltlab.wcf.box</name>
+ <definitionname>com.woltlab.wcf.acl.simple</definitionname>
+ </type>
<!-- /pages -->
<!-- article list box condition -->
<li><a href="{@$__wcf->getAnchor('general')}">{lang}wcf.acp.box.general{/lang}</a></li>
<li><a href="{@$__wcf->getAnchor('contents')}">{lang}wcf.acp.box.contents{/lang}</a></li>
<li><a href="{@$__wcf->getAnchor('pages')}">{lang}wcf.acp.box.pages{/lang}</a></li>
+ <li><a href="{@$__wcf->getAnchor('acl')}">{lang}wcf.acp.box.acl{/lang}</a></li>
{event name='tabMenuTabs'}
</ul>
</dl>
</div>
</div>
+
+ <div id="acl" class="tabMenuContent">
+ {include file='aclSimple'}
+ </div>
</div>
<div class="formSubmit">
use wcf\data\page\Page;
use wcf\data\page\PageNodeTree;
use wcf\form\AbstractForm;
+use wcf\system\acl\simple\SimpleAclHandler;
use wcf\system\box\IConditionBoxController;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\exception\IllegalLinkException;
*/
public $pageNodeList;
+ /**
+ * acl values
+ * @var array
+ */
+ public $aclValues = [];
+
/**
* @inheritDoc
*/
if (isset($_POST['title']) && is_array($_POST['title'])) $this->title = ArrayUtil::trim($_POST['title']);
if (isset($_POST['content']) && is_array($_POST['content'])) $this->content = ArrayUtil::trim($_POST['content']);
if (isset($_POST['boxControllerID'])) $this->boxControllerID = intval($_POST['boxControllerID']);
+ if (isset($_POST['aclValues']) && is_array($_POST['aclValues'])) $this->aclValues = $_POST['aclValues'];
if (WCF::getSession()->getPermission('admin.content.cms.canUseMedia')) {
if (isset($_POST['imageID']) && is_array($_POST['imageID'])) $this->imageID = ArrayUtil::toIntegerArray($_POST['imageID']);
$this->boxController->getProcessor()->saveConditions();
}
+ // save acl
+ SimpleAclHandler::getInstance()->setValues('com.woltlab.wcf.box', $box->boxID, $this->aclValues);
+
// call saved event
$this->saved();
$this->boxType = $this->position = $this->cssClassName = $this->name = '';
$this->showOrder = $this->boxControllerID = 0;
$this->visibleEverywhere = $this->showHeader = 1;
- $this->title = $this->content = $this->images = $this->imageID = $this->pageIDs = [];
+ $this->title = $this->content = $this->images = $this->imageID = $this->pageIDs = $this->aclValues = [];
$this->boxController = null;
}
'availableBoxControllers' => ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.boxController'),
'boxController' => $this->boxController,
'pageNodeList' => $this->pageNodeList,
- 'pageHandlers' => $this->pageHandlers
+ 'pageHandlers' => $this->pageHandlers,
+ 'aclValues' => SimpleAclHandler::getInstance()->getOutputValues($this->aclValues)
]);
}
}
use wcf\data\box\BoxAction;
use wcf\data\object\type\ObjectTypeCache;
use wcf\form\AbstractForm;
+use wcf\system\acl\simple\SimpleAclHandler;
use wcf\system\box\IConditionBoxController;
use wcf\system\exception\IllegalLinkException;
use wcf\system\language\LanguageFactory;
$this->boxController->getProcessor()->saveConditions();
}
+ SimpleAclHandler::getInstance()->setValues('com.woltlab.wcf.box', $this->box->boxID, $this->aclValues);
+
// call saved event
$this->saved();
}
}
+ $this->aclValues = SimpleAclHandler::getInstance()->getValues('com.woltlab.wcf.box', $this->box->boxID);
+
$this->readBoxImages();
}
}
use wcf\data\menu\Menu;
use wcf\data\menu\MenuCache;
use wcf\data\object\type\ObjectTypeCache;
+use wcf\system\acl\simple\SimpleAclResolver;
use wcf\system\box\IBoxController;
use wcf\system\box\IConditionBoxController;
use wcf\system\condition\ConditionHandler;
return [];
}
+ /**
+ * Returns true if this box is accessible by current user.
+ *
+ * @return boolean
+ */
+ public function isAccessible() {
+ return SimpleAclResolver::getInstance()->canAccess('com.woltlab.wcf.box', $this->boxID);
+ }
+
/**
* Returns the box with the given idnetifier.
*
$boxList->sqlOrderBy = 'showOrder';
$boxList->readObjects();
foreach ($boxList as $box) {
- if (!isset($this->boxes[$box->position])) $this->boxes[$box->position] = [];
- $this->boxes[$box->position][] = $box;
- $this->boxesByIdentifier[$box->identifier] = $box;
+ if ($box->isAccessible()) {
+ if (!isset($this->boxes[$box->position])) $this->boxes[$box->position] = [];
+ $this->boxes[$box->position][] = $box;
+ $this->boxesByIdentifier[$box->identifier] = $box;
+ }
}
}