本文整理汇总了PHP中Acl::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Acl::delete方法的具体用法?PHP Acl::delete怎么用?PHP Acl::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Acl
的用法示例。
在下文中一共展示了Acl::delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handlePreDelete
protected function handlePreDelete($id, $values)
{
// remove acls
$acl = new Acl();
$searchcriteria = array('grp_id' => $id['id']);
$acl->delete($searchcriteria);
// remove users
$this->removeUser($id);
}
示例2: handleDeleteObjects
public function handleDeleteObjects($id)
{
// remove all reference objects
$sitePlugin = $this->getSitePlugin();
$siteTag = $this->getSiteTag();
$siteTheme = $this->getSiteTheme();
$acl = new Acl();
$searchKey = array('tree_id' => $id['id']);
$this->handleDeleteObject($searchKey, $sitePlugin);
//$this->handleDeleteObject($searchKey, $siteTag);
//$this->handleDeleteObject($searchKey, $siteTheme);
$siteTag->delete($searchKey);
$siteTheme->delete($searchKey);
$acl->delete($searchKey);
}
示例3: handleAdminEditRootAclPost
private function handleAdminEditRootAclPost()
{
$request = Request::getInstance();
$values = $request->getRequest(Request::POST);
try {
if (!$request->exists('id')) {
throw new Exception('Node ontbreekt.');
}
$id = intval($request->getValue('id'));
$isRootNode = $id == $this->tree->getRootId();
// check if user has execute rights
$auth = Authentication::getInstance();
if (!$auth->canModify($id)) {
throw new HttpException('403');
}
$key = array('id' => $id);
if (!$isRootNode) {
$this->update($key, $values);
}
if ($auth->isRole(SystemUser::ROLE_ADMIN)) {
$acl = new Acl();
$acl->delete(array('tree_id' => $id));
$groupSelect = $request->getValue('acl');
if (is_array($groupSelect)) {
foreach ($groupSelect as $grp_id => $rightsList) {
$rights = 0;
foreach ($rightsList as $item) {
$rights |= $item;
}
$aclValues = array('tree_id' => $id, 'grp_id' => $grp_id, 'rights' => $rights);
$acl->insert($aclValues);
}
}
}
viewManager::getInstance()->setType(ViewManager::ADMIN_OVERVIEW);
$this->handleAdminOverview($id);
} catch (Exception $e) {
$template = new TemplateEngine();
$template->setVariable('errorMessage', $e->getMessage(), false);
if (!$isRootNode) {
// reset date values
$online = $this->sqlParser->getFieldByName('online');
$this->sqlParser->setFieldValue('online', $online->getValue() ? strftime('%Y-%m-%d', strtotime($online->getValue())) : '');
$offline = $this->sqlParser->getFieldByName('offline');
$this->sqlParser->setFieldValue('offline', $offline->getValue() ? strftime('%Y-%m-%d', strtotime($offline->getValue())) : '');
}
$this->handleAdminEditGet(false);
}
}